Users with the most downvotes cast on their questions and answers
Q&A for science fiction and fantasy enthusiasts
SELECT SUM(CASE WHEN a.VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes FROM Votes a INNER JOIN Posts b ON a.PostId = b.Id AND b.PostTypeId IN (1,2) -- Only questions and answers WHERE b.OwnerUserId = ##UserId## AND a.VoteTypeId IN (2,3) -- Only up and down votes