id Email
output:
id email
I found the following query some where can you explain it?
SELECT id, Email =
STUFF((SELECT ', ' + Email
FROM comma b
WHERE b.id = a.id
FOR XML PATH('')), 1, 1, '')
FROM comma a
GROUP BY id
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shahriar NikkhahRank #248 · 10.1K reputationPosted May 7, 2018, 2:59 AM EDT