Draft

0

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

-- Number of new questions per tag over the months
--
-- Repository: https://github.com/pzwd-net/stackoverflow-queries
-- The result of this query is used in 抛砖问答(PZWD). https://pzwd.net/t/top-of-stackoverflow
--
-- Enter Parameters:
--  Keywords: Keywords: (ex: 'java','python','javascript' )
--
SELECT
  dateadd(MONTH, datediff(MONTH, 0, p.CreationDate), 0) AS Month,
  TagName,
  COUNT(*) AS Questions
FROM
  Tags t,
  PostTags pt,
  Posts p
WHERE
  t.Id = pt.TagId
  AND p.Id = pt.PostId
  AND TagName IN ( ##Keywords## )
  AND p.CreationDate < dateadd(MONTH, datediff(MONTH, 0, getdate()), 0)
  AND p.CreationDate > dateadd(MONTH, datediff(MONTH, 0, getdate()) - 25, 0)
  AND p.PostTypeId = 1
GROUP BY
  dateadd(MONTH, datediff(MONTH, 0, p.CreationDate), 0),
  TagName
ORDER BY
  dateadd(MONTH, datediff(MONTH, 0, p.CreationDate), 0),
  TagName

Enter Parameters

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