VoteType Analysis Over Time, By Month/Year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Breaks down all vote types into monthly figures, per post type.

Code Review

Q&A for peer programmer code reviews

select top 1000
  pt.Name PostType,
  year(v.CreationDate) VoteYear,
  month(v.CreationDate) VoteMonth,
  vt.Id VoteTypeId,
  vt.Name VoteType,
  count(*) VoteCount
from votes v 
  inner join votetypes vt on v.votetypeid = vt.id
  inner join posts p on v.postid = p.id
  inner join posttypes pt on p.posttypeid = pt.id
  where year(v.CreationDate) >= 2011
group by
  pt.Name,
  year(v.CreationDate), 
  month(v.CreationDate),
  vt.Id, vt.Name
order by
  pt.Name,
  vt.Id,
  month(v.CreationDate),
  year(v.CreationDate)

Enter Parameters

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