listagg( ) within group ( order by ) 与 wm_concat--oracle 11g 及以后适合 最好select spbywslid,listagg(xm,',') within group (order by spbywslid) col_name from tpg_jtcyqk group by spbywslid;--oracle 10g 及以前版本用select spbywslid,wm_concat(xm)xm from tpg_jtcyqk group by spbywslid;select deptno,wm_concat(ename)name,count(*)rs from emp group by deptnoselect deptno,listagg(ename,',') within group (order by ename ) aa from emp group by deptnoselect deptno,listagg(ename,',') within group (order by ename ) aa,count(*)bb from emp group by deptno