Q&A about the site for members of the workforce navigating the professional setting
-- Post Count by Tag -- Enter Query Description SELECT T.TagName, COUNT(*) as [Total], SUM(CASE WHEN P.AcceptedAnswerId is not null THEN 1 ELSE 0 END) AS [Answered], SUM(CASE WHEN p.ClosedDate IS NOT NULL THEN 1 ELSE 0 END) AS [Closed] FROM POSTS P INNER JOIN PostTags PT on (P.ID=PT.PostID) INNER JOIN Tags T on (PT.TagID=T.ID) WHERE P.PostTypeId = 1 GROUP BY T.TagName ORDER BY Count(*) DESC