Anda dapat menggunakan DISTINCT dalam kueri dalam:
SQL> select XMLAGG(XMLELEMENT(E, cust_name || ',')).EXTRACT('//text()')
2 from (SELECT distinct cust_name, cust_addr_type FROM cust_data)
3 where cust_addr_type ='old_address';
XMLAGG(XMLELEMENT
-----------------
cust1,cust2,