SELECT * FROM (SELECT YEAR(CreationDate) as CreationYear,

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT * FROM 

  (SELECT

    YEAR(CreationDate) as CreationYear,

    --MONTH(CreationDate) as CreationMonth,

    --TagName,

    --UNT(PostId) as PostCount,
    COUNT(PostId) as PostCount

    --RANK() OVER (PARTITION BY YEAR(CreationDate), MONTH(CreationDate) ORDER BY COUNT(PostId) DESC) AS Rank
    
    --RANK() OVER (PARTITION BY YEAR(CreationDate)ORDER BY COUNT(PostId) DESC) AS Rank

  FROM

    Tags, PostTags, Posts

  WHERE 

    Tags.Id = PostTags.TagId and Posts.Id = PostId

  GROUP BY YEAR(CreationDate))

  AS TagPostRankings

WHERE 

  --Rank <= 10 AND 

  CreationYear >= 2005

ORDER BY CreationYear

Enter Parameters

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