Users Answer and Question Votes


Please login or register to vote for this query.

(click on this box to dismiss)

See the total up and down votes for answers and questions for a given user.

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @userid int = ##UserID##

  when p.posttypeid = 1 then 'Question'
  when p.posttypeid = 2 then 'Answer'
end) as [Post Type],
  when v.votetypeid = 2 then 'Up Vote'
  when v.votetypeid = 3 then 'Down Vote'
end) as [Vote Type], 
count(*) As Votes
from votes v join posts p on v.postid =
where v.votetypeid in (2,3) and v.userid = @userid
group by p.posttypeid, v.votetypeid

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results