问题
I have strings in the following formats
Akram_88_jamesstree_20140418, Akram_8_johnstreet_20140418, Akram_888_johnstreet_20140418,
Now I want to retrieve only the 88,8 and 888 value only, for which i have written the following query
SUBSTR(a.file_name, 7, INSTR(a.file_name, '_')-5) as output
now the problem with this query is i just get 88 -8 and 88 of 888.
The output will be compared to another column so i want just 88,8 and 888 numeric values.
回答1:
SELECT REGEXP_SUBSTR('Akram_88_jamesstree','[0-9]+')
Here put your column Name in place of 'Akram_88_jamesstree'.
来源:https://stackoverflow.com/questions/23153080/regex-to-get-numeric-from-string-in-oracle