My table contains the details like with two fields. I want to get the the unique details with DisplayName like: I want to know how to do this is Parallel Data Warehouse/APS since the FOR XML PATH function is not supported in PDW.
1 Editor,Reviewer 7 EIC,Editor,Reviewer
ID DisplayName
1 Editor
1 Reviewer
7 EIC
7 Editor
7 Reviewer
7 Editor
19 EIC
19 Editor
19 Reviewer
I've tried the following code which would work on a traditional SQL Server but "For XML Path' function is not supported in APS.
SELECT id, displayname =
STUFF((SELECT DISTINCT ', ' + displayname
FROM #t b
WHERE b.id = a.id
FOR XML PATH('')), 1, 2, '')
FROM #t a
GROUP BY id