Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

substr and or instr 1

Status
Not open for further replies.

cheesyman5k

Programmer
Oct 19, 2007
9
US
hello all,

can you help me create the correct substring or intstring statement to return everything after the last underscore of a column value?

for example:

column value = 'cheesy_man_5000'
return value should be '5000'

column value = 'tek_tips_is_the_best'
return value should be 'best'

I thank you all in advance!

cheesy
 
SELECT substr('tek_tips_is_the_best', instr('tek_tips_is_the_best', '_',-1)+1) from dual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top