Q: Combine fields into one column I have the following data set:
user_id | advr1_id | advr1_name | advr2_id | advr2_name | advr3_id | advr3_name
--------+----------+------------+----------+------------+----------+-----------
      7 |       22 | John Smith |       15 |   Jane Doe |        9 | Bill Clint
      8 |       15 |   Jane Doe |       10 |    Kim Gol |     null | null

I want to make another column advrs that contains all the advr names (this would be at the placed into the record above).
user_id | advrs
--------+---------------------------------
      7 | John Smith; Jane Doe; Bill Clint
      8 | Jane Doe; Kim Gol

I can achieve this with listagg() but it is super slow... is there an alternative method I don't know about?

A: Something like this maybe:
select user_id, 
       replace(
           listagg(
               advr1_name 
               || decode(advr2_name, null, '', '# ' || advr2_name)
               || decode(advr3_name, null, '', '# ' || advr3_name)
               , '; '
               ) within group (order by advr1_name), 
           '#', ';'
       )
from your_tab
group by user_id;      


A: Not pretty or terribly efficient, and not exactly scalable if you ever add advr4... or more, but this might do the job quicker than listagg:
ltrim(rtrim(replace(advr1_name||'; '||advr2_name||'; '||advr3_name, '; ; ', '; '), '; '),'; ')

