Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language
SELECT DATEADD(mm, (Year(Posts.CreationDate) - 1900) * 12 + Month(Posts.CreationDate) - 1, 0) AS Month, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ( 'java' ) AND PostTypes.Name = 'Question' AND -- Exclude the current month Posts.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) AND Posts.CreationDate > '2018/01/01 00:00:00' GROUP BY Year(Posts.CreationDate), Month(Posts.CreationDate), Tags.TagName ORDER BY Year(Posts.CreationDate), Month(Posts.CreationDate), Tags.TagName