Hi All,
Oracle DB version: 11.2.0.2
I have gone through previous posts and found the following query to concat rows into columns:
select rtrim(xmlagg(xmlelement(e, empno || ',')).extract('//text()').extract('//text()') ,',') empnos from emp
/
EMPNOS
--------------------------------------------------------------------------------
7369,7499,7521,7566,7654,7698,7782,7788,7839,7844,7876,7900,7902,7934
But what if I have duplicate records in the table emp? I want distinct records to be concatenated into a single column. Could you please help me out.
Thanks in advance.
Regards,
Imran Khan