Posts by month, year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature

Q&A for scholars and enthusiasts of literature

SELECT 
  sub_test.y, 
  sub_test.m, 
  COUNT(sub_test.Id)
FROM Posts p

INNER JOIN 
  (SELECT p.Id, YEAR(CreationDate) AS y, MONTH(CreationDate) AS m
    FROM Posts p
    WHERE p.PostTypeId = 1) sub_test
ON p.Id = sub_test.Id

GROUP BY sub_test.y, sub_test.m
ORDER BY sub_test.y, sub_test.m

Enter Parameters

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