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 remove multiple commas in a string

kumar73May 29 2012 — edited May 30 2012
Hello Friends,

I have a string like 'asdfgf,pqrstu,,asff,,prquste,'

Need to convert into a single comma seperated string like 'asdfgf,pqrstu,asff,prquste,'

I have used RTRIM('asdfgf,pqrstu,,asff,,prquste,' , ',') but commas in between the string is not removed but only on the right side of the string

select RTRIM('asdfgf,pqrstu,,asff,,prquste,' , ',') from dual ;

I want in a single select statement.

Please advice.

Thanks/Kumar
This post has been answered by Hoek on May 29 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2012
Added on May 29 2012
7 comments
3,976 views