Trend of questions posted last month compared to answers

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

declare @monthAgo date = dateadd(month, -1, getdate());

select
  cast(CreationDate as date) as Created,
  count(Id) as Posted,
  sum(AnswerCount) as Answers,
  sum(AnswerCount) + (count(Id) - sum(AnswerCount)) / 2 as Median
from
  posts
where
  (1=1)
  and PostTypeId = 1
  and cast(CreationDate as date) >= @monthAgo
  and cast(CreationDate as date) < cast(getdate() as date)
group by
  cast(CreationDate as date)
order by
  Created asc

Enter Parameters

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