I have the following data:
column1 column2
1 aaa
1 bbb
2 ccc
2 ddd
2 eee
The expected output should be one row per column1 type which contains all of the column2 data, as below:
column1, column2
1, aaa|bbb
2, ccc|ddd|eee
How can I get this output ?
I am Using below Query to get this data.
select sub_id,listagg(pack_name, '|') within group(order by sub_id) package_name
from Recon_Droppacks_Migration group by sub_id;
col1:sub_id
col2:pack_name
table:Recon_Droppacks_Migration