I have a table with data as below:
a | b | c | d
a | b | c | e
a | b | c | f
g | h | i | j
g | h | i | k
g | h | i | l
I want to convert the data as below:
a | b | c | d | e | f
g | h | i | j | k | l
Tried as below. But it didn't work.
select col1, col2, col3,
rtrim(xmlagg(xmlelement(e, col4 || ',')).extract ('//text()'), ',') val
from TABLEA
group by col1, col2, col
Could you please help me on this?