Find posts with the most comments

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP 50 p.Id AS [Post Link], COUNT(c.Id) AS NumComments
FROM Posts p
JOIN Comments c ON p.Id = c.PostId
GROUP BY p.Id
ORDER BY -COUNT(c.Id)

Enter Parameters

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