This is my SQL Server
table data
id Name
1 Active
2 On-Hold
3 Closed
4 Cancelled
5 Active
6 On-Hold
7 Closed
8 Cancelled
9 Active
10 On-Hold
11 Closed
12 Cancelled
How can I query the table so that the results look like:
Name Id
Active 1,5,9
On-Hold 2,6,10
Closed 3,7,11
Cancelled 4,8,12