Find all numeric-only tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Shows all numeric-only tags in the system, and the number of questions tagged with each one.

Chess Meta

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) DESC

Enter Parameters

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