Average score of all answers (depending on month of questions' creationdate)

0

Please login or register to vote for this query.

(click on this box to dismiss)

MathOverflow

Q&A for professional mathematicians

with ascore_cte AS
(
SELECT 
  q.Id AS qid,
  q.CreationDate AS cre,
  SUM(a.Score) AS ascore
FROM Posts q INNER JOIN Posts a ON a.ParentId=q.Id
WHERE q.PostTypeId=1
GROUP BY q.Id, q.CreationDate
)

SELECT
  eomonth(cre),
  AVG(CAST(ascore AS decimal)) AS [Average sum of answer-scores]
FROM ascore_cte
GROUP BY eomonth(cre)
ORDER BY eomonth(cre)

Enter Parameters

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