SELECT p.Id AS QuestionId, p.Title AS QuestionTitle, COUN...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Artificial Intelligence Meta

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;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results