Distribution of number of votes on questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Russian Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Russian language

-- compute for each question how many votes it has 
--(question means posttypeid = 1)
with a as (
   Select Count(v.PostId) n_votes
   from Votes v join Posts p 
   on v.PostId = p.Id
   where p.PostTypeId in (1) and v.VoteTypeId in (2,3)
   group by p.Id
)

--- Create histogram
select n_votes, Count(n_votes) 
from a
group by n_votes
order by n_votes

Enter Parameters

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