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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Substr / Instr question 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 second to last underscore of a column value?

for example:

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

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

I thank you all in advance!

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

Part and Inventory Search

Sponsor

Back
Top