WITH RankedUsers AS ( SELECT UserID, COUNT(*) AS CommentC...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Earth Science

Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences

WITH RankedUsers AS (
    SELECT UserID, COUNT(*) AS CommentCount, 
           ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS RowNum
    FROM Comments
    GROUP BY UserID
)
SELECT UserID
FROM RankedUsers
WHERE RowNum = 1;

Enter Parameters

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