[Oracle11g] Group by 상세 문자열 합치기 by JD




SELECT deptno, LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) AS employees

FROM emp

GROUP BY deptno; 


 DEPTNO EMPLOYEES---------- -------------------------------------------------- 

 10 CLARK,KING,MILLER 

 20 ADAMS,FORD,JONES,SCOTT,SMITH 

 30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD


3 rows selected.



출처 : https://oracle-base.com/articles/misc/string-aggregation-techniques

덧글

댓글 입력 영역


통계 위젯 (화이트)

12
26
30319