Created
October 21, 2016 09:48
-
-
Save Chetan496/526792c5dc58cf1691a5357676ed9c96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LISTAGG in Oracle | |
SELECT deptno, LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) AS employees | |
FROM emp | |
GROUP BY deptno; | |
Using the WM_CONCAT function: | |
SELECT deptno, wm_concat(ename) AS employees | |
FROM emp | |
GROUP BY deptno; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment