Average question score per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

MathOverflow

Q&A for professional mathematicians

SELECT
  DATEADD(mm, (Year(Posts.CreationDate) - 1900) * 12 + Month(Posts.CreationDate) - 1, 0) AS Month,
  AVG(Posts.score) AS Score
FROM Posts
  LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId
WHERE
  PostTypes.Name IN ('Question') AND
  Posts.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0)
  
GROUP BY
  Year(Posts.CreationDate), Month(Posts.CreationDate)

ORDER BY
  Year(Posts.CreationDate), Month(Posts.CreationDate)

Enter Parameters

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