Total Question Closure

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
    NumClosed,
    NumQuestions,
    NumClosed * 100.0 / NumQuestions AS PercentClosed
FROM (
    SELECT
        COUNT(CASE WHEN ClosedDate IS NOT NULL THEN 1 END) AS NumClosed,
        COUNT(*) AS NumQuestions
    FROM Posts
    WHERE
        PostTypeId = 1 -- Questions
) Counts

Enter Parameters

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