QUERY: count tags from daterange

0

Please login or register to vote for this query.

(click on this box to dismiss)

TODO: compare from two different dateranges...

Stack Overflow

Q&A for professional and enthusiast programmers

-- QUERY: count tags from daterange
-- TODO: compare from two different dateranges...

select TOP 10
    tags.tagname, count(*) AS tagcount
from Posts
    INNER JOIN PostTags ON PostTags.PostId = Posts.id
    INNER JOIN Tags     ON Tags.id         = PostTags.TagId 
where
    datepart(year,  Posts.CreationDate) = 2011 and
    datepart(month, Posts.CreationDate) = 1
Group by tags.tagname
Order by tagcount DESC

Enter Parameters

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