方法一:

select field1,listagg(field3,',') within GROUP (order by field3) from test group by field1;

方法二(在方法一报出所拼接的字符串长度过长时,使用方法二):

select field1,xmlagg(xmlparse(content field3||',' wellformed) order by field3).getclobval() from test1 group by field1

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐