-1

I have below table, where I am trying to merge the columns in yellow in one column, while maintaining the original columns; the data in the highlighted yellow columns is populated based on the interaction type they fall into if the interaction type is null that means it doesn't fall into the interaction type category:

Would appreciate any help or guidance on how I can approach this

enter image description here

Expected outcome: enter image description here

GMB
  • 216,147
  • 25
  • 84
  • 135
NewCode
  • 109
  • 1
  • 8

1 Answers1

1

This looks like coalesce():

select t.*,
    coalesce(
        svc_proc, 
        interest, 
        transtypekey, 
        connectivity_name, 
        vm_entreprise_program,
        channels
    ) as interaction_details
from mytable t

coalesce() returns the first non-null value of the arguments list.

GMB
  • 216,147
  • 25
  • 84
  • 135