I have a database table with users who work at several office locations. These Locations are identified by a number and in my table, I have several users appearing on several rows for each office location they work at. What I want is a SQL query which will combine the records and show all the office locations in one field separated by a coma.
This is my original table:
Id    UserName    OfficeNumber
---   ---------   -------------
1     user01      200
2     user02      220
3     user01      290
4     user03      089
5     user02      019
I want my final table to look like below after running the query:
Id    UserName    OfficeNumber
---   ---------   -------------
1     user01      200, 290
2     user02      220, 019
3     user03      089
Any help will be highly appreciated.