How many upvotes and downvotes have I received?

1

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

SELECT 
  SUM(CASE WHEN a.VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes,
  SUM(CASE WHEN a.VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes,
  (CAST(SUM(CASE WHEN a.VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(*)) * 100 AS UpVotePercentage,
  (CAST(SUM(CASE WHEN a.VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(*)) * 100 AS DownVotePercentage
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

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results