DECLARE @UserId int = ##UserId## SELECT Sum(CASE p.PostT...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

DECLARE @UserId int = ##UserId##

SELECT Sum(CASE p.PostTypeId WHEN 1 THEN 1 ELSE 0 END) [QuestionVotes]
,      Sum(CASE p.PostTypeId WHEN 2 THEN 1 ELSE 0 END) [AnswerVotes]
FROM Posts p
INNER JOIN Votes v ON
      v.PostId = p.Id
  AND v.VoteTypeId in (2, 3)
WHERE v.UserId = @UserId


SELECT * FROM Postfeedback

Enter Parameters

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