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...

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

-- 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
having count(*) > 1
Order by tagcount

Enter Parameters

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