Q&A for ebook publishers and readers
SELECT DATEADD(month, DATEDIFF(month, 0, Posts.CreationDate), 0) as Month, COUNT(*) as IssueCount, AVG(CAST(Posts.Score as FLOAT)) as AvgScore, SUM(Posts.ViewCount) as TotalViews FROM Posts LEFT JOIN PostTags ON Posts.Id = PostTags.PostId LEFT JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('customer-service', 'complaints', 'booking-problems', 'cancellation') AND Posts.PostTypeId = 1 GROUP BY DATEADD(month, DATEDIFF(month, 0, Posts.CreationDate), 0) ORDER BY Month DESC;