Most controversial users

1

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

WITH Raw AS (
  SELECT
    MIN(Posts.OwnerUserId) AS UserId,
    COUNT(CASE WHEN Votes.VoteTypeId = 2 THEN 1 END) AS Ups,
    COUNT(CASE WHEN Votes.VoteTypeId = 3 THEN 1 END) AS Downs
  FROM Posts, Votes
  WHERE
    Votes.PostId = Posts.Id
    AND
    Votes.VoteTypeId BETWEEN 2 AND 3
    AND
    Posts.OwnerUserId > 0
  GROUP BY Posts.Id
)
SELECT TOP 100
  UserId AS [User Link],
  SUM(Ups) AS TotalUps,
  SUM(Downs) AS TotalDowns,
  SUM(CASE WHEN Ups > Downs THEN Downs ELSE Ups END) AS Controversity
FROM Raw
GROUP BY UserId
ORDER BY Controversity DESC, UserId

Enter Parameters

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