Ratio answers/questions posted per month (including deleted posts)

0

Please login or register to vote for this query.

(click on this box to dismiss)

MathOverflow

Q&A for professional mathematicians

with counts_cte AS
(
SELECT eomonth(p.CreationDate) AS Cmonth,
  COUNT(p.Id) AS PCount,
  SUM(case when p.PostTypeId = 1 then 1 else 0 end) AS QCount,
  SUM(case when p.PostTypeId = 2 then 1 else 0 end) AS ACount
FROM PostsWithDeleted p
GROUP BY eomonth(p.CreationDate)
)

SELECT
  Cmonth,
  (CAST(ACount AS decimal))/(CAST(QCount AS decimal)) [Answers to questions ratio]
FROM counts_cte
ORDER BY Cmonth

Enter Parameters

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