Trends

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

select
rate4.TagName as Tag,
row_number() over (order by rate4.Rate desc) as Q1Rank,
row_number() over (order by rate5.Rate desc) as Q2Rank,
rate4.Rate as Q1,
rate5.Rate as Q2

from

(select count(PostId) as Rate, TagName
from
Tags, PostTags, Posts
where Tags.Id = PostTags.TagId and Posts.Id = PostId
and Posts.CreationDate > DATEADD(month, -3, GETDATE())
and Posts.CreationDate <= GETDATE()
group by TagName) as rate4

LEFT JOIN

(select count(PostId) as Rate, TagName
from
Tags, PostTags, Posts
where Tags.Id = PostTags.TagId and Posts.Id = PostId
and Posts.CreationDate > DATEADD(month, -6, GETDATE())
and Posts.CreationDate <= DATEADD(month, -3, GETDATE())
group by TagName) as rate5
ON rate5.TagName = rate4.TagName

order by Q1Rank
;

Enter Parameters

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