Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language
SELECT c.PostId AS AnswerId, STUFF(( SELECT ' | ' + c2.Text FROM Comments c2 WHERE c2.PostId = c.PostId ORDER BY c2.CreationDate FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)'), 1, 3, '') AS AllComments FROM Comments c JOIN Posts p ON c.PostId = p.Id WHERE p.Id IN (12453584, 2988271) AND p.PostTypeId = 2 -- PostTypeId = 2 indicates answers GROUP BY c.PostId ORDER BY c.PostId;