Asked Questions per month for a given Tag


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with temp as (
select count(l.PostId) as Posts_num, l.TagId as TagId, 
YEAR(r.CreationDate) as CreationYear, MONTH(r.CreationDate) as CreationMonth
from PostTags as l join PostHistory as r on l.PostId = r.PostId
Group by TagId, CreationDate
tt as (
select sum(Posts_num) as PostsCount, TagId, CreationYear, CreationMonth from temp
group by CreationYear, CreationMonth, TagId
SELECt TagName, CreationYear, CreationMonth  from
(select TagId, max(CreationYear) as CreationYear, CreationMonth, max(PostsCount) as MaxPostsCount from tt
group by TagId, tt.creationmonth ) AS er left join Tags on er.TagId=Tags.Id

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results