For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
one option
with t as 2 (select '2222jhone' str 3 from dual 4 union all 5 select '123344Sam' str 6 from dual 7 union all 8 select '11Tim' str 9 from dual) 10 select regexp_substr(str,'[[:digit:]]*') 11 from t; REGEXP_SU --------- 2222 123344 11
SQL> ed Wrote file afiedt.buf 1* SELECT REPLACE(TRANSLATE(UPPER('12345abcdABC12345'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',' '),' ','') FROM DUAL SQL> / REPLACE(TR ---------- 1234512345 SQL>
SQL> select trim(translate(str,translate(str,'1234567890',' '),' ')) number_char 2 from (select '2222jhone' str from dual union all 3 select '123344Sam' str from dual union all 4 select '11Tim' str from dual); NUMBER_CHAR ----------- 2222 123344 11 SQL>