following situation, pos/neg_text are repeating:
This is my feedback table:
id text-id pos_text neg_text cat_id
1 1 nice people null 21
2 1 nice people null 24
3 1 nice people null 27
4 1 null cold room 36
5 1 null cold room 37
I would like to bring all these data into a single row like:
id text-id pos_text neg_text pos_cat_id neg_cat_id
1 1 nice people cold room "21,24,27" "36,37"
How should my SQL query look like? I am implementing an algorithm with TypeScript in my middleware to solve this problem, and maybe there are DB-specialists can solve that much more elegant with a simple SQL-Query.
Using SQL Server 2008