Si vous souhaitez concaténer des valeurs sur plusieurs lignes, utilisez l'astuce FOR XML, par exemple :
SELECT Name + ','
FROM Project
FOR XML PATH('')
Voici un exemple plus complet :
select LineItemID, (
Select m.Material + ','
From test.Materials m
inner join test.LineItems_Materials lm1 on m.MaterialID = lm1.MaterialID
Where m.MaterialID in (select MaterialID from test.LineItems_Materials where LineItemID = lm2.LineItemID)
FOR XML PATH('')
) as Materials
from test.LineItems_Materials lm2
group by LineItemID