I am using LISTAGG to collapse my data, have duplicate values staggard on a row. When I do it, its giving me duplicates. My oracle verision is 12 I think so I cant use DISTINCT inside LISTAGG. Does anyone know how I can fix this?
SELECT
col1,
col2,
col3,
col4,
col5,
listagg( col6, ', ')within group (order by col6) as policies ,
col7
FROM my_table
group by
col1,
col2,
col3,
col4,
col5,
col7