Reputaiton and Accepted Answer

1

Please login or register to vote for this query.

(click on this box to dismiss)

Writing

Q&A for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

SELECT
    u.Reputation,
    COUNT(CASE WHEN p.Id = q.AcceptedAnswerId THEN 1 END) AS AcceptedAnswers,
    COUNT(*) AS TotalAnswers,
    CAST(COUNT(CASE WHEN p.Id = q.AcceptedAnswerId THEN 1 END) AS FLOAT) / COUNT(*) AS AcceptanceRate
FROM
    Posts p
JOIN
    Users u ON p.OwnerUserId = u.Id
JOIN
    Posts q ON p.ParentId = q.Id
WHERE
    p.PostTypeId = 2 -- 2 for Answers
GROUP BY
    u.Reputation
ORDER BY
    u.Reputation;

Enter Parameters

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