distribution of up and downvotes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Signal Processing Meta

Q&A about the site for practitioners of the art and science of signal, image and video processing

with a as (
select p.id,
       sum(case when v.votetypeid = 2 then 1 else 0 end) as upvotes, 
       sum(case when v.votetypeid = 3 then 1 else 0 end) as downvotes 
from posts p join votes v 
on p.id = v.PostId
where p.PostTypeId = 2 and v.votetypeid in (2,3) --, p.ParentID = ##ParentQuestion:int?6095##
group by p.id
)

select count(id) from a 
group by upvotes, downvotes
order by upvotes,downvotes

Enter Parameters

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