Comma separate two separate columns

I have done a search for this but i cannot find anything, what i am trying to do is take all the rows from two columns and turn them into one row, still two columns, but each column is comma separated.

For example

Customerid    |    FacilityId
-----------------------------
1                    5678
2                    9101
5                    6543

Then afterwards id like the results to be like this

Customerid    |    FacilityId
-----------------------------
1,2,5            5678,9101,6543


Source: sql

Leave a Reply