Number of downvotes and upvotes on posts by a specific user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

SELECT p.Id AS [Post Link], SUM(CASE WHEN v.VoteTypeId=3 THEN 1 ELSE 0 END), SUM(CASE WHEN v.VoteTypeId=2 THEN 1 ELSE 0 END)
FROM Votes v JOIN Posts p ON v.PostId=p.Id
WHERE (p.OwnerUserId=##id?210401##) AND (v.VoteTypeId IN (2,3))
GROUP BY p.Id
ORDER BY p.Id ASC
--VoteTypeId=3 downvotes
--VoteTypeId=2 upvotes

Enter Parameters

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