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 @ 2018-01-03 17:40  膜拜曾文正  阅读(10562)  评论(0编辑  收藏  举报