Vote count per post

0

Please login or register to vote for this query.

(click on this box to dismiss)

For when you haven't been granted the "privilege" yet.

Stack Overflow

Q&A for professional and enthusiast programmers

-- Enter Query Title
-- Enter Query Description
DECLARE @PostId int  = ##PostId##

SELECT vt.Name, COUNT(*) 
FROM Votes v
  INNER JOIN VoteTypes vt ON v.VoteTypeId = vt.Id
WHERE v.PostId = @PostId
GROUP BY vt.Name

Enter Parameters

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