select sum(case when votetypeid = 2 then 1 else 0 end) as...

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 sum(case when votetypeid = 2 then 1 else 0 end) as upmod
     , sum(case when votetypeid = 3 then 1 else 0 end) as downmod
     , min(creationdate) as first
     , max(creationdate) as last
     , postid
from votes
group by postid

Enter Parameters

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