Answered Count by Post State

0

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity Meta

Q&A about the site for committed Christians, experts in Christianity and those interested in learning more

SELECT
    HasAnswer,
    State,
    COUNT(*) AS NumPosts,
    ROUND((100.0 * COUNT(*)) / SUM(COUNT(*)) OVER (), 2) AS PercentPosts
FROM (
    SELECT
        CASE
            WHEN AnswerCount IS NULL THEN 'Unknown'
            WHEN AnswerCount >= 1 THEN 'Yes'
            ELSE 'No'
        END AS HasAnswer,
        CASE
            WHEN DeletionDate IS NOT NULL THEN 'Deleted'
            WHEN ClosedDate IS NOT NULL THEN 'Closed'
            ELSE 'Open'
        END AS State
    FROM PostsWithDeleted
    WHERE PostTypeId = 1 -- Questions
) AS x
GROUP BY HasAnswer, State
ORDER BY HasAnswer, State

Enter Parameters

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