Oracle同一字段用逗号分隔(列转行)

--分组加排序,数据量大时结果会比较慢 

SELECT listagg(t.ename,',') WITHIN GROUP(ORDER BY t.sal) FROM scott.emp t;
--查询结果为CLOB 

SELECT wm_concat(t.ename) FROM scott.emp t ORDER BY t.sal;
posted @ 2020-04-23 17:25  岁月淡忘了谁  阅读(6454)  评论(0编辑  收藏  举报