语法:
xmlagg(xmlparse(content 拼接字段 || ','wellformed) order by 排序字段).getclobval()
例如:取出所有的城市ID 为一行数据。
select
xmlagg(xmlparse(content t.ID || ',' wellformed) order by t.pid).getclobval()
from DEMO t;
Mybatis的话用String接收就可以了 resultType=“String”