I am using regex to string unique sources. My issue is the sources are merging:
i.e. sources [manager, ream, ream, ream]
Needed output [manager, ream]
Output receiving [manageream, ream]
SELECT regexp_replace( listagg(c.source, ',')
within group(order by c.person_no) ,
'([^,]+)(,\1)+', '\1') source
FROM table c
How do I fix my above code to get the needed output?
listagg. You can do this more easily without it.