Virtual Meta Reputation

1

Please login or register to vote for this query.

(click on this box to dismiss)

Constructed Languages

Q&A for designers and users of artificial or invented languages, consciously developed instead of having developed naturally

SELECT
  SUM(CASE
    WHEN v.VoteTypeId = 1 THEN 15
    WHEN v.VoteTypeId = 2 THEN 10
    WHEN v.VoteTypeId = 3 THEN -2
  END) AS Reputation,
  COUNT(CASE v.VoteTypeId WHEN 1 THEN 1 END) AS Accepts,
  COUNT(CASE WHEN v.VoteTypeId = 2 AND p.PostTypeId = 1 THEN 1 END) AS QuestionsUpVotes,
  COUNT(CASE WHEN v.VoteTypeId = 2 AND p.PostTypeId = 2 THEN 1 END) AS AnswerUpVotes,
  COUNT(CASE v.VoteTypeId WHEN 3 THEN 1 END) AS DownVotes
FROM Posts p
  INNER JOIN Votes v ON p.Id = v.PostId
  INNER JOIN Users u ON p.OwnerUserId = u.Id
WHERE v.VoteTypeId IN (1,2,3) -- accepts,ups,downs
  AND p.OwnerUserId = ##UserId:int##

Enter Parameters

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