Ordered by total downvotes / (total upvotes + total downvotes)
Q&A for professional and enthusiast programmers
-- Problem Users -- Ordered by total downvotes / (total upvotes + total downvotes) create table #TotalVotes(UserId int, Upvotes int, Downvotes int, Reputation int) insert into #TotalVotes (UserId, Reputation) select Id, Reputation from Users where Reputation > 1000 update #TotalVotes set Upvotes = ( select count(*) from Votes v join Posts p on v.PostId = p.Id where UserId = OwnerUserId and ClosedDate is null and CommunityOwnedDate is null and VoteTypeId = 2 ) , Downvotes = ( select count(*) from Votes v join Posts p on v.PostId = p.Id where UserId = OwnerUserId and ClosedDate is null and CommunityOwnedDate is null and VoteTypeId = 3 ) select UserId as [User Link], Upvotes, Downvotes, Reputation from #TotalVotes order by (DownVotes / (Upvotes + Downvotes + 0.0)) desc