Score, upvotes, downvotes for a specific post

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics Meta

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

SELECT
  p.Score,
  SUM(Case When v.VoteTypeId = 2 Then 1 Else NULL End) AS UpVotes,
  SUM(Case When v.VoteTypeId = 3 Then 1 Else NULL End) AS DownVotes
FROM Votes v INNER JOIN Posts p ON v.PostId=p.Id
WHERE p.Id=##id?9659##
GROUP BY p.Id, p.Score

Enter Parameters

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