Total anonymous feedback for given user


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 professional and enthusiast programmers

DECLARE @UserId INT = ##UserId##;

SELECT u.DisplayName
     , 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
JOIN   Users        u ON u.Id = p.OwnerUserId
WHERE  p.OwnerUserId = @UserId
GROUP  BY u.DisplayName;

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results