Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs
SELECT pq.Id as id, pq.Tags as tags, pq.Title as title, pq.Body as question, pa.Body as answers, pq.CreationDate as creation FROM posts pq LEFT JOIN ( SELECT pa.ParentId, STRING_AGG(pa.Body, CHAR(10)) as body FROM posts pa WHERE ParentId IS NOT NULL GROUP BY pa.ParentId ) pa ON pa.ParentId = pq.id WHERE pq.ParentId IS NULL AND Id > ##LOWER## AND Id < ##HIGHER## ORDER BY Id