I have a table where all the records are identical, besides the values in one column. Something like this:
City | Warehouse | OrderID | CustomerID |
---|---|---|---|
San Diego | SD1 | 1234 | 5678 |
San Diego | SD2 | 1234 | 5678 |
San Diego | SD3 | 1234 | 5678 |
What SQL syntax/logic can I use in order to return one singular record, where the unique values from the Warehouse column are combined into one row?
Expected output:
City | Warehouse | OrderID | CustomerID |
---|---|---|---|
San Diego | SD1, SD2, SD3 | 1234 | 5678 |