how to avoid amp;
I don't want replace . In STUFF and XMLPATH is there any chance to avoid this ?
DECLARE @TEMP TABLE(ID INT, [VALUE] NVARCHAR(30))
INSERT INTO @TEMP VALUES(1 , 'MAZ')
INSERT INTO @TEMP VALUES(1 , 'HON & DON')
INSERT INTO @TEMP VALUES(1 , 'FOR')
INSERT INTO @TEMP VALUES(2 , 'JEEP')
INSERT INTO @TEMP VALUES(2 , 'CHE')
--------------------WITH STUFF FUNCTION
SELECT [id],
Stuff((SELECT ',' + [VALUE]
FROM @TEMP
WHERE [id] = a.[id]
FOR xml path('')), 1, 1, '') [VALUE]
FROM @TEMP a
GROUP BY [id]