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 = 0 THEN 'No'
            ELSE 'Yes'
        END AS HasAnswer,
        CASE
            WHEN DeletionDate IS NULL THEN 'Deleted'
            WHEN ClosedDate IS NULL THEN 'Closed'
            ELSE 'Open'
        END AS State
    FROM Posts
    WHERE Posts.PostTypeId = 1 -- Questions
) AS x
GROUP BY HasAnswer, State

Enter Parameters

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