I have a table which has data like :-
id name data
1 a 10
1 b 20
1 c 30
2 d 40
2 e 50
Now, If I want to convert the rows into columns(giving them a unique name) and aggregate the data row (using xmlagg) ... How can I get output like
id name_1 name_2 name_3 data
1 a b c 10,20,30
2 d e 40,50
So basically convert rows into columns and rename them and aggregate the data related to them.