Rank users by what fraction of their answers are accepted

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

DECLARE @MinAnswers int = ##MinAnswers##

SELECT
    TOP 20
    Users.Id AS [User Link],
    Count(*) as "Answers",
    Cast(Count(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 END) as Float) / Count(*) AS "Fraction"
FROM Posts a
    INNER JOIN Posts q
        ON a.ParentId = q.Id
    INNER JOIN Users
        ON a.OwnerUserId = Users.Id
GROUP BY Users.Id
HAVING COUNT(*) >= @MinAnswers
ORDER BY "Fraction" DESC

Enter Parameters

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