select deptno, rtrim (xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enames from emp group by deptno