Q&A about the site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment
SELECT p.Id AS QuestionId, p.Title AS QuestionTitle, COUNT(c.Id) AS NumberOfComments FROM Posts p LEFT JOIN Comments c ON p.Id = c.PostId WHERE p.PostTypeId = 1 -- PostTypeId = 1 indicates that the post is a question GROUP BY p.Id, p.Title ORDER BY NumberOfComments DESC;