SELECT TOP 50 [year], Tag, COUNT(*) QuestionCount FROM (...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Martial Arts Meta

Q&A about the site for students and teachers of all martial arts

--SELECT COUNT(*) FROM Posts;  -- 54255054
--SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1;  -- 21769820

SELECT TOP 50 [year], Tag, COUNT(*) QuestionCount
  FROM (
SELECT YEAR(CreationDate) [year], p.Id, t.Tag
  FROM Posts p
 OUTER APPLY (
     SELECT REPLACE(REPLACE(value, '<', ''), '>', '') Tag
       FROM STRING_SPLIT(p.Tags, '>')
      WHERE LEN(value) > 0) t
 WHERE PostTypeId = 1 ) raw -- questions
 WHERE [year] IN (2021)
 GROUP BY [year], Tag
 ORDER BY COUNT(*) DESC

--SELECT MAX(CreationDate) FROM Posts WHERE PostTypeId = 1;

Enter Parameters

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