Top-rated users if there was no reputation cap

1

Please login or register to vote for this query.

(click on this box to dismiss)

Interpersonal Skills Meta

Q&A about the site for people looking to improve their interpersonal communication skills

-- Top-rated users if there was no reputation cap

SELECT TOP 1000
    Users.Id as [User Link],
    Users.Reputation,
    SUM(CASE
      WHEN VoteTypeId = 1 THEN 15                    -- Accepted answer
      WHEN VoteTypeId = 2 AND PostTypeId = 1 THEN 5  -- Upvoted question
      WHEN VoteTypeId = 2 AND PostTypeId = 2 THEN 10 -- Upvoted answer
      WHEN VoteTypeId = 3 THEN -2                    -- Downvote
      WHEN VoteTypeId = 9 THEN BountyAmount          -- Earned Bounty
    END) AS UncappedReputation,
    SUM(CASE
      WHEN VoteTypeId = 1 THEN 15                    -- Accepted answer
      WHEN VoteTypeId = 2 AND PostTypeId = 1 THEN 5  -- Upvoted question
      WHEN VoteTypeId = 2 AND PostTypeId = 2 THEN 10 -- Upvoted answer
      WHEN VoteTypeId = 3 THEN -2                    -- Downvote
      WHEN VoteTypeId = 9 THEN BountyAmount          -- Earned Bounty
    END) - Reputation as LostReputation
FROM
    Votes
  INNER JOIN 
    Posts ON Posts.Id = Votes.PostId
  INNER JOIN
    Users ON Users.Id = Posts.OwnerUserId
GROUP BY
    Users.Id,
    Users.Reputation
ORDER BY
    UncappedReputation DESC

Enter Parameters

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