Hi Experts,
I'm doing a string aggregation but not able to get
Distinct values aggregated.
Ex -
with xx as(
select 'A' a from dual union all
select 'B' a from dual union all
select 'C' a from dual union all
select 'C' a from dual union all
select 'D' a from dual
)
select rtrim(xmlagg(xmlelement(e,x.a||',')).extract('//text()'),',') from xx x;
gives
A,B,C,C,D
Expected o/p :
A,B,C,D
Is there any other String Aggregation techniques which can achieve this?
Please suggest ideas.
Thanks in Advance.
Ranit B.
Oracle Database version - 11.2.0.2.0