Example: select deptno, rtrim (xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enames from emp group by deptno ; DEPTNO ENAMES ---------- ---------------------------------------- 10 CLARK,MILLER,KING 20 SMITH,FORD,ADAMS,SCOTT,JONES 30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD Please see : http://www.dba-oracle.com/t_xmlagg.htm