Posts where the first revision had a single tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Show the tags that were the sole tag on the first revision of a post. For each tag, show the number of posts that started out with just this tag.

Webmasters

Q&A for pro webmasters

-- Posts where the first revision had a single tag
-- Show the tags that were the sole tag on the first revision of a post.
-- For each tag, show the number of posts that started out with just this tag.

SELECT '(total)' As [Tag], Count(*) As [Posts]
FROM PostHistory
WHERE PostHistoryTypeId = 3 AND PatIndex('%àé%', Text) = 0
GROUP BY PostHistoryTypeId
UNION
SELECT Replace(Substring(Text, 2, Len(Text) - 2), 'ö', '-') As [Tag],
       Count(*) As [Posts]
FROM PostHistory
WHERE PostHistoryTypeId = 3 AND PatIndex('%àé%', Text) = 0
GROUP BY Text
ORDER BY Posts DESC

Enter Parameters

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