Skip to Main Content

SQL & PL/SQL

Announcement

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!

return a string from a series of values

user520824Dec 6 2019 — edited Dec 6 2019

Hello,

I like to return the string between two commas. But looks like my syntax is wrong. Can someone please help?

Eg. return hello from the string ('test, hello, done')

My Below sql is not giving the correct result.

select 'test, hello, done', substr('test, hello, done', instr(  substr('test, hello, done', 1,  length('test, hello, done') ), ',', 1), instr(  substr('test, hello, done', 1,  length('test, hello, done') ), ',', -2))   from dual

, hello, don

string should be:  hello

This post has been answered by L. Fernigrini on Dec 6 2019
Jump to Answer
Comments
Post Details
Added on Dec 6 2019
14 comments
1,353 views