WITH p AS (SELECT OwnerUserId, SUM(Score) AS Score FROM ...

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

-- 27779;
-- 4397

WITH p AS (SELECT OwnerUserId, SUM(Score) AS Score FROM Posts WHERE OwnerUserId IS NOT NULL GROUP BY OwnerUserId),
r AS (SELECT OwnerUserId, DENSE_RANK() OVER(ORDER BY Score DESC) AS Ranking FROM p)
SELECT u.DisplayName, u.Id, r.Ranking FROM r INNER JOIN Users u ON r.OwnerUserId = u.Id AND u.Id = 27779;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results