SELECT count(*) as TotalVotes, SUM(CASE WHEN PostTypeId =...

8

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
       count(*) as TotalVotes,
       SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS QuestionVotes
FROM    Votes v JOIN Posts p ON v.PostId=p.Id
WHERE  UserId =  ##UserId##;

Enter Parameters

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