I am using MSSQL database and I have a table named UserDepartments that has all the Departments ID that assigned to one user as the following
UserID | DepartmentID
1 | 220
1 | 330
1 | 210
1 | 100
2 | 330
2 | 440
3 | 550
what i want exactly to create a VIEW of that table that show it as the following
UserID | Departments
1 | 220, 330, 210, 100
2 | 330, 440
3 | 550
is it possible to do it using MSSQL?