方法一:
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
方法一:
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