Oracle 10g: parsing 2 columns merging duplicates

前端 未结 1 766
一个人的身影
一个人的身影 2021-01-22 19:49

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:

相关标签:
1条回答
  • 2021-01-22 20:04

    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;
    
    0 讨论(0)
提交回复
热议问题