Created
February 1, 2019 20:15
-
-
Save sboysel/fc982c31f01e3048d820e10b93813f6d to your computer and use it in GitHub Desktop.
Most popular Stack Overflow tags (Stack Exchange Data Explorer query)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
num.TagName as Tag, | |
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) > 1) | |
as num ON rate.TagName = num.TagName | |
order by rate.rate desc | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment