Q&A about the site for Muslims, experts in Islam, and those interested in learning more about Islam
SELECT q.CreationDate as [CREATED], ISNULL(q.AcceptedAnswerId, 0) as [ANSWERED], YEAR(q.CreationDate) AS [YEAR], DATEPART(wk, q.CreationDate) AS [WEEK], t.TagName AS [tagname], COUNT(q.Id) AS [NUMQUESTIONS], SUM(q.ViewCount) AS [NUMVIEWS], SUM(q.AnswerCount) AS [NUMANSWERS], SUM(q.CommentCount) AS [NUMCOMMENTS] -- MEDIAN(q.Score, FROM Posts q INNER JOIN PostTags pt ON q.Id = pt.PostId INNER JOIN Tags t ON pt.TagId = t.Id WHERE (q.PostTypeId=1) ---only questions (although answers do not have tags, so this is not necessary) -- AND (t.TagName in ('oracle','oracle-cloud-infrastructure')) AND (t.TagName in ('datadog')) -- and q.CreationDate < '2022-01-23' -- and q.CreationDate >= '2022-01-16' -- GROUP BY t.TagName; GROUP BY q.CreationDate, q.AcceptedAnswerId, YEAR(q.CreationDate), DATEPART(wk, q.CreationDate), t.TagName ORDER BY YEAR(q.CreationDate), DATEPART(wk, q.CreationDate), t.TagName ASC;