Most-loved users (least-downvoted as a percentage of total reputation)

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP 200
 Posts.OwnerUserId AS [User Link],
 Users.Reputation,
 sum(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) AS [Downvotes For This User's Posts],
 FORMAT(sum(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) * 100.0 / Users.Reputation, '##0.###', 'en-us') AS [Downvotes As Percentage Of Reputation]
 
FROM

 Posts
     JOIN Votes ON Votes.PostId = Posts.Id
     JOIN Users ON Users.Id = Posts.OwnerUserId
 
WHERE Posts.PostTypeId = 1
AND Users.Reputation >= ##MinimumReputation?4000##

GROUP BY Posts.OwnerUserId, Users.Reputation

HAVING sum(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) >= ##MinimumDownVotes?0##

ORDER BY [Downvotes As Percentage Of Reputation] ASC, Users.Reputation DESC

Enter Parameters

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