Q&A for science fiction and fantasy enthusiasts
Select row_number() over(order by count(postId) desc) tagID, tagname, count(postid) From PostTags p inner join tags t on p.tagId = t.id Group by tagname