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


Please login or register to vote for this query.

(click on this box to dismiss)


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
JOIN Votes v ON
  v.PostId = p.Id
WHERE v.UserId = @UserId

SELECT Count(*) FROM Votes v
WHERE v.UserId = @UserId

Enter Parameters

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