-1

I have a table that looks like this

enter image description here

I want to create a query so that same values of column 1 and column 2 (tcbname and status) are grouped and column 3 (scope_name) lists all the scopes related to that status and tcb_name.

Below is my expected outcome

| TUVAmerica, inc | | E | |<all the scope_name values that match first two column>|

1 Answers1

1

It seems to me you need group_concat()

 select tcb_name ,status,
 group_concat(scope_name separator ',') as list_of_scope
 from your_table
 group by tcb_name,status
Zaynul Abadin Tuhin
  • 31,407
  • 5
  • 33
  • 63