Percent of Questions that have an answer

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 FORMAT(COUNT(CASE WHEN AnswerCount > 0 THEN 1 END), 'N0') As QuestionsAnswered,
       FORMAT(COUNT(*), 'N0') As QuestionsAll,
       FORMAT(CAST(COUNT(CASE WHEN AnswerCount > 0 THEN 1 END) AS FLOAT) / COUNT(*), 'P0') As AnsweredPercent
FROM Posts
WHERE PostTypeId = 1

Enter Parameters

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