http://meta.stackexchange.com/questions/273645/trends-on-stack-overflow
Q&A for professional and enthusiast programmers
select dateadd(m, -datediff(m, p.creationdate, getdate()),getdate()) , sum(case when tagname ='python' then 1 else 0 end) as [Python] , sum(case when tagname ='java' then 1 else 0 end) as [java] , sum(case when tagname ='c#' then 1 else 0 end) as [c#] from posts p inner join posttags pt on pt.postid = p.id inner join tags t on t.id = pt.tagid where tagname in ('python', 'java', 'c#') and p.creationdate < eomonth(getdate(),-1) group by datediff(m, p.creationdate, getdate()) order by 1 desc