Upvote/Downvote ratio for the users over a rep limit

1

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

WITH Raw AS (
  SELECT
    Posts.OwnerUserId AS UserId,
    MIN(Users.Reputation) AS Reputation,
    COUNT(CASE WHEN Votes.VoteTypeId = 2 THEN 1 ELSE NULL END) AS UpVotes,
    COUNT(*) AS AllVotes
  FROM Users, Posts, Votes
  WHERE
    Users.Reputation >= ##MinRep:int?3000##
    AND
    Votes.PostId = Posts.Id
    AND
    Posts.OwnerUserId = Users.Id
    AND
    Votes.VoteTypeId IN (2,3)
  GROUP BY Posts.OwnerUserId
)
SELECT
  UserId AS [User Link],
  UserId,
  Reputation,
  UpVotes,
  AllVotes - UpVotes AS DownVotes,
  100.0 * UpVotes / AllVotes AS UpVotePct
FROM Raw
ORDER BY UpVotePct DESC, UserId

Enter Parameters

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