SELECT ID, LEFT([Name], LEN([Name]) - 1) as [Name] FROM ( SELECT DISTINCT ID FROM tablename ) AS A OUTER APPLY ( SELECT RTRIM(B.Name) + ' -- ' FROM tablename B WHERE A.ID = B.ID FOR XML PATH('') ) AS C ([Name])
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)