select dateadd(month, datediff(month, 0,creationdate), 0)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science Meta

Q&A for scientists using computers to solve scientific problems

select dateadd(month, datediff(month, 0,creationdate), 0) wk, 
count(*) as cnt      
into #neg
from posts
where score  < 0
group by dateadd(month, datediff(month, 0,creationdate), 0)
order by dateadd(month, datediff(month, 0,creationdate),0) asc


select dateadd(month, datediff(month, 0,creationdate), 0) wk, 
count(*) as cnt      
into #pos
from posts
where score > 0
group by dateadd(month, datediff(month, 0,creationdate), 0)
order by dateadd(month, datediff(month, 0,creationdate),0) asc


select #neg.wk, cast(#neg.cnt as float)/#pos.cnt rat
from #neg
join #pos on #pos.wk = #neg.wk
where #pos.cnt > 10
order by #neg.wk asc

Enter Parameters

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