Closure vote counts, per reason

1

Please login or register to vote for this query.

(click on this box to dismiss)

Counts of the number of close votes (not the number of closed questions) for each close reason. Note that this query is naturally limited by the fact that deleted questions are purged from Stack Exchange Data Explorer, and hence do not appear in these results.

Stack Overflow

Q&A for programmers

SELECT Reasons.MarkdownMini AS CloseReason
     , Reasons.ApprovalDate AS DateIntroduced
     , Creator.DisplayName AS [Created By]
     , Approver.DisplayName AS [Approved By]
     , COUNT(*) AS Votes
    FROM
        CloseAsOffTopicReasonTypes AS Reasons
            LEFT OUTER JOIN PendingFlags
                ON Reasons.Id = PendingFlags.CloseAsOffTopicReasonTypeId
            LEFT OUTER JOIN Users AS Creator
                ON Reasons.CreationModeratorId = Creator.Id
            LEFT OUTER JOIN Users AS Approver
                ON Reasons.ApprovalModeratorId = Approver.Id
    WHERE
        Reasons.DeactivationDate IS NULL AND
        (
            PendingFlags.CloseReasonTypeId IS NULL OR (
                PendingFlags.CloseReasonTypeId = 102 AND -- Off-topic
                PendingFlags.FlagTypeId IN (13, 14)      -- Canned flag for closure OR Vote to close
            )
        )
    GROUP BY Reasons.Id, Reasons.ApprovalDate, Creator.DisplayName, Approver.DisplayName, Reasons.MarkdownMini
UNION ALL
SELECT 'Duplicate', NULL, NULL, NULL, COUNT(CASE WHEN CloseReasonTypeId = 101 THEN 1 END)
    FROM PendingFlags
UNION ALL
SELECT 'Unclear what you''re asking', NULL, NULL, NULL, COUNT(CASE WHEN CloseReasonTypeId = 103 THEN 1 END)
    FROM PendingFlags
UNION ALL
SELECT 'Too broad', NULL, NULL, NULL, COUNT(CASE WHEN CloseReasonTypeId = 104 THEN 1 END)
    FROM PendingFlags
UNION ALL
SELECT 'Primarily opinion-based', NULL, NULL, NULL, COUNT(CASE WHEN CloseReasonTypeId = 105 THEN 1 END)
    FROM PendingFlags;

Enter Parameters

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