I have a problem with dividing comma separated values. I have 2 columns with comma separated values, for ex:
ID Name
1,2,3 Ab,cd,ef
I want the columns divided as:
Id Name
1 ab
2 cd
3 ef
I used:
xmltable('r/c' passing xmltype('<r><c>' || replace(ID,',','</c><c>') || '</c></r>')
columns ID_NEW varchar2(400) path '.') <br/>
Output was:
ID Name
1 ab,cd,ef
2 ab,cd,ef
3 ab,cd,ef
I'm using Oracle 10g.
Best Answer
Is this what you're looking for? I'm using regexp_substr
This is the SQL Fiddle.