'Extract numbers from string in sql

In my Table there is a column called Comment and it contains data like

input
Comment

| 22 | 22 | INTERNAL AUDIT | NM | OK                  
| Multiplied by 4 | 32 | 32 | INTERNAL AUDIT | TR | None         
| 19 | 17 | INTERNAL AUDIT | LM | FIXED       
| REF#R7F282CT

we need to extract only numbers from this comment column and update into other column

need output like this like:

col1   col2
22     22              
32     32        
19     17      
null   null

input image

Input result

Output image

Output result



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source