Posts, Answers, Comments, Favourits, and Views By Month Year, and Tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

SELECT 

  DATEADD(
    DD,
    -1,
    DATEADD(
      MM, 
      DATEDIFF(
        MM,
        0,
        [Posts].[CreationDate]
      )
      +1,
    0)
  ) AS EndOfMonth,
  [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 


  DATEADD(
    DD,
    -1,
    DATEADD(
      MM, 
      DATEDIFF(
        MM,
        0,
        [Posts].[CreationDate]
      )
      +1,
    0)
  ),
  [Posts].[Tags]
  
ORDER BY 

  [EndOfMonth] DESC,
  [NumberOfTags] DESC

Enter Parameters

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