Q&A about the site for active researchers, academics and students of physics
SELECT Posts.Id AS [Post Link], Posts.Score AS 'Score', COUNT(CASE WHEN Votes.VoteTypeId = 2 THEN 1 END) AS 'UpVotes', COUNT(CASE WHEN Votes.VoteTypeId = 3 THEN 1 END) AS 'DownVotes' FROM Posts JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.Id = ##post:int## -- post: Post Id to query AND (Votes.VoteTypeId = 2 OR Votes.VoteTypeId = 3) GROUP BY Posts.Id, Posts.Score