|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Get Numbers when characters found
Hello
Is there a function in ORACLE that you could use to get say the coulmn has 5474kkkkdkMKDKKD, you only extract 5474. OR IF you encounter 54//d773hms--kd in the column, then you extract only 54. Thanks |
|
#2
|
|||
|
|||
|
Here you go
![]() 1) select translate('sdfsdf4545dsafasd1232312','0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ','0123456789') from dual; Result : 45451232312 2) select translate('sdfsdf4545dsafasd1232312','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','x') from dual; Result: 4545xx1232312 With the second query you could use another functions(decode,substr...etc) and it will return all the characters before the occurence of the 'x'.. Also if you have characters other than the alphabets just add them to the long abc....string hth, Jiggee Last edited by jiggee : October 21st, 2004 at 01:50 PM. Reason: Extra info |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Get Numbers when characters found |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|