SELECT Pro_ID,STUFF((SELECT ','+KW_Name FROM Table WHERE Pro_ID = A.Pro_ID FOR XML PATH('')),1,1,'') AS [KW_Name] FROM Table A GROUP BY Pro_ID