most popular new tags by votes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Engineering

Q&A for professionals and students of engineering

select 
       row_number() over (order by votes.Votes desc) as VoteRank,
       row_number() over (order by posts.Posts desc) as PostRank,
       votes.TagName as Tag,
       votes.Votes as "Votes   ",
       posts.Posts as "Posts   "
       
from

(select Tags.TagName, count(distinct Votes.Id) as Votes
 from
   Tags, PostTags, Posts, Votes
 where Tags.Id = PostTags.TagId
   and Posts.Id = PostTags.PostId
   and Votes.PostId = Posts.Id
   and Votes.CreationDate > '2019-11-01'
 group by Tags.TagName
 having count(distinct Votes.Id) > 500
) 
as votes

inner join

(select Tags.TagName, count(distinct Posts.Id) as Posts
 from
   Tags, PostTags, Posts
 where Tags.Id = PostTags.TagId
   and Posts.Id = PostTags.PostId
   and Posts.CreationDate > '2019-11-01'
 group by Tags.TagName
) 
as posts on votes.TagName = posts.TagName

order by votes.votes desc
;

Enter Parameters

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