Q&A for people interested in the history and origins of science and mathematics
SELECT [PostsAgg].*, ROW_NUMBER() OVER(ORDER BY [PostsAgg].[NumberOfTags] DESC) AS MonRank FROM ( SELECT MONTH([Posts].[CreationDate]) AS PostMon, YEAR([Posts].[CreationDate]) AS PostYear, [Posts].[Tags], COUNT(*) as NumberOfTags, SUM([Posts].[AnswerCount]) AS NumberOfAnswers, SUM([Posts].[CommentCount]) AS NumberOfComments, SUM([Posts].[FavoriteCount]) AS NumberOfFavourites, SUM([Posts].[ViewCount]) AS NumberOfViews FROM [Posts] WHERE [Posts].[Tags] IS NOT NULL GROUP BY MONTH([Posts].[CreationDate]), YEAR([Posts].[CreationDate]), [Posts].[Tags] ) PostsAgg