Count of reviews by types, monthly history

2

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

WITH Raw AS (
  SELECT
    ReviewTasks.Id,
    DATEFROMPARTS(
      DATEPART(yyyy, ReviewTasks.CreationDate),
      DATEPART(mm, ReviewTasks.CreationDate),
      1) AS Month,
    ReviewTaskTypes.Name AS Type
  FROM ReviewTasks, ReviewTaskTypes
  WHERE
    ReviewTasks.ReviewTaskTypeId = ReviewTaskTypes.Id
)
SELECT
  Month,
  Type,
  COUNT(*) AS Count
FROM Raw
GROUP BY Month, Type
ORDER BY Month, Type

Enter Parameters

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