Try this..CREATE TABLE #Tset(NAME varchar(MAX),NUMBER int,[CASE] int)INSERT INTO #Tset VALUES('SMITH',10,3),('SMITH',10,4),('JONES',12,1),('BROWN',13,2),('BROWN',13,5)SELECT DISTINCT NAME,NUMBER,STUFF((SELECT ','+CAST([CASE] AS varchar(max)) FROM #Tset T WHERE T.NUMBER = T1.NUMBER AND T.NAME = T1.NAME FOR XML PATH('')),1,1,'') FROM #Tset T1 DROP TABLE #Tset
---------------Murali KrishnaYou live only once ..If you do it right once is enough.......