Skip to content
Advertisement

I want row data of same id in one single row

The Table Format is like

I want to result as following

Advertisement

Answer

first concate two columns and then do string_agg. Here is the demo.

output:

If you are using older version of SQL Server then try the following

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement