您可以在内部查询中使用DISTINCT:
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,
您可以在内部查询中使用DISTINCT:
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,