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!

How to get the part of string before and after a character

1619206Jul 31 2014 — edited Aug 1 2014

Hi All,

How to get the string before and after the character comma ( , )

Ex: The string contains value John,Kennedy

I need the output as first stirng - John

                              Second stirng - Kennedy

create table names (fullname varchar2(20));

insert into names values ('John,Kennedy');

insert into names values ('Rikin,Shan');

insert into names values ('Don,Bosco');

select * from names ;

Expected Output

fullname                 firstname  lastname

John,Kennedy         John         Kennedy

Rikin,Shan              Rikin         Shan

Don,Bosco              Don           Bosco

Please let me know how to do this

Thanks,

This post has been answered by Frank Kulash on Jul 31 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2014
Added on Jul 31 2014
3 comments
14,184 views