Q&A for professional robotic engineers, hobbyists, researchers and students
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