CREATE TABLE T ( [f1] VarCHAR(100), [f2] VarCHAR(100)) go INSERT INTO T VALUES ('a','abc') INSERT INTO T VALUES ('a','b') INSERT INTO T VALUES ('b','XX') go SELECT F1, NameValues=STUFF( (SELECT ','+F2 FROM T WHERE F1=Results.F1 FOR XML PATH('')) ,1,1,'') FROM T Results GROUP BY F1 |