Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Concatenar resultados de uma consulta SQL no Oracle


-- Oráculo 10g --
SELECT deptno, WM_CONCAT(ename) AS employees
  FROM   scott.emp
GROUP BY deptno;

Output:
     10  CLARK,MILLER,KING
     20  SMITH,FORD,ADAMS,SCOTT,JONES
     30  ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD