Top users by total score

1

Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

SELECT TOP(##num?500##)
  u.Id AS [User Link], 
  u.DisplayName,
  u.Reputation,
  SUM(p.Score) AS [Total Score],
  SUM(case when p.PostTypeId = 1 then 1 else 0 end) AS [Total Questions],
  SUM(case when p.PostTypeId = 2 then 1 else 0 end) AS [Total Answers],
  SUM(case when p.PostTypeId = 1 then p.Score else 0 end) AS [Score Questions],
  SUM(case when p.PostTypeId = 1 then p.Score else 0 end) AS [Score Answers]
FROM Users u INNER JOIN Posts p ON p.OwnerUserId=u.Id
GROUP BY u.Id, u.Reputation, u.DisplayName
ORDER BY SUM(p.Score) DESC

Enter Parameters

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