Q&A for professional and enthusiast programmers
(count(case when VoteTypeId = 2 then 1 else 0 end) + 0.0) / DATEPART(day, EOMONTH(MIN(Votes.CreationDate)))
as 'upvotes per day',
(count(case when VoteTypeId = 3 then 1 else 0 end) + 0.0) / DATEPART(day, EOMONTH(MIN(Votes.CreationDate)))
as 'downvotes per day'
-- It would be nicer to only do one inner join of PostTags with
-- an "or" in the "on" condition. However, that takes significantly
-- longer for some reason. It's strange really: getting this data
-- for only questions or only answers is super fast, but combining
-- them... a lot slower.
left join PostTags qTags
on qTags.PostId = Posts.Id
left join PostTags aTags
on aTags.PostId = Posts.ParentId
inner join Votes on Votes.PostId = Posts.Id
(VoteTypeId = 2 OR VoteTypeId = 3) AND
(qTags.TagId = 59148 or aTags.TagId = 59148) AND -- that's 'rust'
Votes.CreationDate > '2013-01-01'
order by min(Votes.CreationDate)