Unanswered Questions by Tag

2

Please login or register to vote for this query.

(click on this box to dismiss)

Shows all tags with at least 3000 questions, their total questions and of those, how many are unanswered.

Stack Overflow

Q&A for professional and enthusiast programmers

-- Unanswered Questions by Tag
-- Shows all tags with at least 3000 questions, their total questions and
-- of those, how many are unanswered.

DECLARE @minQuestionCount int = 3000

SELECT
  *
FROM
  (
    -- All unanswered questions grouped by tag
    SELECT
      t.TagName AS TagName,
      COUNT(1) AS UnansweredCount,
      t.Count AS QuestionCount
      FROM Posts q
      INNER JOIN PostTags pt ON q.Id = pt.PostId
      INNER JOIN Tags t ON pt.TagId = t.Id
      WHERE
        (q.PostTypeId = 1) AND
        (q.ClosedDate IS NULL) AND
        NOT EXISTS
        (
          SELECT *
            FROM Posts a
            WHERE
              (a.ParentId = q.Id) AND
              ((a.Score > 0) OR (a.Id = q.AcceptedAnswerId))
        )
      GROUP BY TagName, t.Count
  ) a
WHERE a.QuestionCount > @minQuestionCount
ORDER BY
    TagName

Enter Parameters

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