Ratio answers/questions posted per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computer Science Educators

Q&A for those involved in the field of teaching Computer Science

with counts_cte AS
(
SELECT eomonth(p.CreationDate) AS Cmonth,

  SUM(case when p.PostTypeId = 1 then 1 else 0 end) as Asked,
  SUM(case when p.AnswerCount > 0 then 1 else 0 end) as Answered
  
FROM Posts p
GROUP BY eomonth(p.CreationDate)
)

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

Enter Parameters

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