I am working on to create a sql query. I tried multiple links within stackoverflow and googled it but cant fond a solution. I have the below:
column_name
1,2,3,string1
3,1,string2
4,5,string3
2,4,string1
So i want the below output for this:
1,2,3,4,5,string1,string2,string3,string4
basically i want to get all the unique values from a comma separated column.I know distinct gives different vales compared to each row in the column, but how can we do it when in the above situation.
Note: I am using Oracle 11g database. Kaushik's Answer looks good in SQL Fiddler. but its not working me as i have more than 20k rows. IS there any alternative ?