SELECT ID,
STUFF((SELECT ',' + FieldName
FROM Table
WHERE ID = t.ID
FOR XML PATH('')),1,1,'')
FROM (SELECT DISTINCT ID FROM Table)t
If field has special characters like >,< etc use below
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c
No comments:
Post a Comment