Total anonymous feedback for given user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sum of up and down votes for all posts of a given user.

Stack Overflow

Q&A for programmers

DECLARE @UserId INT = ##UserId##;

SELECT COUNT (CASE WHEN pf.VoteTypeId = 2 THEN 1 ELSE NULL END) AS Helpful
     , COUNT (CASE WHEN pf.VoteTypeId = 3 THEN 1 ELSE NULL END) AS Unhelpful
FROM   PostFeedback pf
JOIN   Posts        p ON p.Id = pf.PostId
WHERE  p.OwnerUserId = @UserId;

Enter Parameters

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