Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
-- Most popular StackOverflow tags overall select num.TagName as Tag, row_number() over (order by rate.Rate desc) as MayRank, row_number() over (order by num.Num desc) as TotalRank, rate.Rate as QuestionsInMay, num.Num as QuestionsTotal from (select count(PostId) as Rate, TagName from Tags, PostTags, Posts where Tags.Id = PostTags.TagId and Posts.Id = PostId group by TagName) as rate INNER JOIN (select count(PostId) as Num, TagName from Tags, PostTags, Posts where Tags.Id = PostTags.TagId and Posts.Id = PostId group by TagName having count(PostId) > 800) as num ON rate.TagName = num.TagName order by rate.rate desc ;