All Forums Analytics
RahulG 2 posts Joined 05/08
14 Jul 2008
I want to extract number from String

Suppose I have string likeRD_S0310RD_153RDH_S0906RD_S0083I want output031015309060083How can I do this

j355ga 100 posts Joined 12/05
14 Jul 2008

Simple way assuming all numbers are preceded by _ or _s:select case when substr(col_1, index(col_1 '_') +1, character_length(col_1)) from mytableunionselect case when substr(col_1, index(col_1 '_s') +1, character_length(col_1)) from mytable;other wise you should use recursive sql.

Jeff

Sai088 13 posts Joined 03/12
06 Mar 2012

 how to Return digits or alphas from a string 

for example:123ab45cde6789fg

You must sign in to leave a comment.