select t1.ID, t1.name + '-' + t2.name from myTable t1 JOIN myTable t2 ON(t1.ID = t2.ID)
SELECT ID, REPLACE(RTRIM((SELECT Name + ' ' FROM myTable WHERE (ID = t.ID) FOR XML PATH (''))),' ',' - ') FROM myTable t GROUP BY ID
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)