listagg函数
select a ,b ,c ,listagg(列名, '连接符') within group(order by 列名) from table group by 列名 order by a ,b ,c
若查询对象是中文, 结果为乱码 对查询结果列进行包装处理(同理可解决其他查询结果的处理问题):
select a ,b ,c ,listagg(to_char(列名), '连接符') within group(order by 列名) from table group by 列名 order by a ,b ,c
select Listagg(a,',') within group(order by a) from table group by a
select Listagg(a,',') within group(order by b) from table group by a