I have a following table
PK | NAME | FK |
---|---|---|
01 | abc | 01FK |
02 | bca | 01FK |
03 | cab | 02FK |
04 | xyz | 03FK |
05 | yzx | 02FK |
I want to generate a new table where FK is the primary and the rest of the column(s) merge based on FK. So the end result looks something like this:
FK | NAME |
---|---|
01FK | abc, bca |
02FK | cab, yzx |
03FK | xyz |