Concatenating a single column into a single row in SQL Server Management Studio
问题 I am trying to compile a list of dumpsters at a given location that a driver needs to pick up. I have a table like this: Stop Number Dumpster Number ------------------------------------ 1 245 1 248 2 312 2 314 2 316 I would like it to look like this: Stop Number Dumpster Number ------------------------------- 1 245 248 2 312 314 316 The code I built is below, but I am getting the same result as the first table, with just the spaces on the end. SELECT [StopNumber], CAST((CONCAT([ContainerID],'