Oracle 10g: Parsing 2 Columns Merging Duplicates
I'm having a table with 3 columns: DATE_A, DATE_B and ISSUE DATE_A and DATE_B can be filled in 3 possible ways: either both have a value, or only one have, as shown here: DATE_A
Solution 1:
If I understand correctly, you want a union all
of the date values and string aggregation. listagg()
was introduced in 11g, but you can use wm_concat()
:
select dte, wm_concat(issue) as issues
from ((select date_a as dte, issue from t where date_a is not null) union all
(select date_b, issue from t where date_b is not null)
) di
group by dte
order by dte;
Post a Comment for "Oracle 10g: Parsing 2 Columns Merging Duplicates"