Number of non-deleted questions with answers per month

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

with questionsWithAnswerCount as
(
  SELECT p.id, max(p.CreationDate) as creationDate, count(*) as answers
  FROM Posts p
  INNER JOIN Posts a ON a.parentId = p.id and a.postTypeId = 2
  WHERE p.PostTypeId = 1
  GROUP BY p.id
)


SELECT MIN(creationDate), COUNT(*) AS 'Questions with 1 or more answers'
FROM questionsWithAnswerCount
WHERE answers >= 1
GROUP BY (CAST(YEAR(creationDate) as nvarchar(4)) + '-' + CAST(MONTH(creationDate) as nvarchar(2)))
ORDER BY MIN(creationDate) ASC

Enter Parameters

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