oracle wm_concat函数 列转行 分组函数

(1)select mark, wm_concat(status) from DISSENT_INFO t GROUP BY mark;

查出来的数据

mark     status

222        1007,1006
333        1008,1008
444        1008

(2)

SQL> select deptno,listagg(ename,',')within group(order by sal)name from emp group by deptno;

    DEPTNO NAME
---------- ----------------------------------------------------------------------------------------------------
    10 MILLER,CLARK,KING
    20 SMITH,ADAMS,JONES,FORD,SCOTT
    30 JAMES,MARTIN,WARD,TURNER,ALLEN,BLAKE
posted @ 2019-01-16 20:17  ConfidentLiu  阅读(765)  评论(0编辑  收藏  举报