SQL> SELECT deptno,
listagg (ename, ',') WITHIN GROUP (ORDER BY ename)
enames
FROM emp
GROUP BY deptno
/
DEPTNO ENAMES
---------- --------------------------------------------------
10 CLARK,KING,MILLER
20 ADAMS,FORD,JONES,SCOTT,SMITH
30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
3 rows selected.
SELECT column_1, wmsys.wm_concat(column_2) CONCAT
FROM test_wm
GROUP BY column_1;
SELECT column_1, TRANSLATE(wmsys.wm_concat(column_2), 'A,', 'A ') CONCAT
FROM test_wm
GROUP BY column_1;
No comments:
Post a Comment