Q&A for professional and enthusiast programmers
Select Votes.PostId, sum(case VoteTypeId when 2 then 1 else -1 end) as score from Votes where VoteTypeId in (2,3) group by Votes.PostId