Select Votes.PostId, sum(case VoteTypeId when 2 then 1 el...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

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

Enter Parameters

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