select col1,col2, stuff((select','+ t1.col3 from Test t1 where t1.col1=t2.col1 FOR XML PATH('')),1,1,'') as result from Test t2 group by col1,col2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)