Total number of Tags and active Tag Synomyms

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

WITH numTags AS (
    SELECT  'Number of Tags'    AS [Item],
            COUNT (t.ID)        AS [Count]
    FROM    Tags t
),
numSyns AS (
    SELECT  'Number of active Synonyms' AS [Item],
            COUNT (ts.ID)               AS [Count]
    FROM    TagSynonyms ts
    WHERE   ts.ApprovalDate IS NOT NULL
)
SELECT              [Item], [Count]
FROM                numTags
UNION ALL SELECT    [Item], [Count]
FROM                numSyns
UNION ALL SELECT    'Total'                 AS [Item],
                    t.[Count] + s.[Count]   AS [Count]
FROM                numTags t,
                    numSyns s

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results