Shows all numeric-only tags in the system, and the number of questions tagged with each one.
Q&A about the site for serious players and enthusiasts of chess
-- Find all numeric-only tags -- Shows all numeric-only tags in the system, and the number of questions tagged with each one. WITH c AS ( SELECT TagName, (SELECT COUNT(PostId) FROM PostTags WHERE PostTags.TagId = Tags.Id) AS Count FROM Tags WHERE ISNUMERIC(TagName) = 1 ) SELECT (CASE WHEN GROUPING(TagName) = 1 THEN '(Total)' ELSE TagName END) AS 'Tag Name', SUM(Count) AS 'Question Count' FROM c GROUP BY TagName WITH ROLLUP ORDER BY (CASE WHEN TagName IS NULL THEN 1 ELSE 0 END), SUM(Count)