Following code is not working -
SELECT [LY-1],
LY = STUFF((SELECT ',' + name FROM temp1 FOR XML PATH ('')), 1, 1, '' )
FROM temp1
GROUP BY [LY-1];
As it is giving below error-
Msg 103010, Level 16, State 1, Line 73 Parse error at line: 2, column: 36: Incorrect syntax near 'temp1'.
Does STUFF and FOR XML are not working Data warehouse ? and is there any alternative for them?