Number of votes on answers and votes on questions 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
  eomonth(v.CreationDate),
  COUNT(v.Id) AS [Total Upvotes],
  SUM(CASE WHEN p.PostTypeId=1 THEN 1 ELSE 0 END) AS [Question Upvotes],
  SUM(CASE WHEN p.PostTypeId=2 THEN 1 ELSE 0 END) AS [Answer Upvotes]
FROM Posts p INNER JOIN Votes v ON v.PostId = p.Id
WHERE v.VoteTypeId=2
---VoteTypeId=2 Upvotes
---VoteTypeId=3 Downvotes
GROUP BY eomonth(v.CreationDate)
ORDER BY eomonth(v.CreationDate)

Enter Parameters

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