count by year for a tag

1

Please login or register to vote for this query.

(click on this box to dismiss)

Programming Language Design and Implementation

Q&A for designers and implementers of computer programming languages

SELECT
    t.TagName,
    YEAR(p.CreationDate) AS Year,
    COUNT(*) AS QuestionsCount
FROM
    Posts p
JOIN
    PostTags pt ON p.Id = pt.PostId
JOIN
    Tags t ON pt.TagId = t.Id
WHERE
    p.PostTypeId = 1  -- Filter to include only questions 
    and
    t.TagName = ##TagName##
GROUP BY
    YEAR(p.CreationDate),
    t.TagName

Enter Parameters

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