Percent negative scored questions

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 year(p.CreationDate), month(p.CreationDate), count(p.Id),  
    (sum(CASE WHEN p.Score <= 0 THEN 1 ELSE 0 END) * 100.0) /count(p.Id) as negative_pct
from Posts as p, PostTypes as types
where p.PostTypeId = types.id and types.Name = 'Question' 
group by year(p.CreationDate), month(p.CreationDate)
order by year(p.CreationDate), month(p.CreationDate) asc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results