SELECT COUNT(*) Count, SUM(CASE WHEN AcceptedAnswerId IS ...

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
  COUNT(*) Count,
  SUM(CASE WHEN AcceptedAnswerId IS NOT NULL THEN 1 ELSE 0 END) Accepted,
  SUM(CASE WHEN AcceptedAnswerId IS NOT NULL THEN 1 ELSE 0 END) * 100.0 / COUNT(*) PercentAccepted
FROM Posts
WHERE CreationDate BETWEEN '2012-01-01' AND '2012-06-01'
AND PostTypeId = 1

Enter Parameters

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