Average reputation for answering users


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 AVG(CASE WHEN nbAns >= 1 THEN Reputation END)
FROM (SELECT u.id as uid, COUNT(p.id) as nbAns
FROM Users as u
INNER JOIN Posts as p ON p.OwnerUserId = u.id
WHERE PostTypeId = 2
GROUP BY u.id) as countAns
INNER JOIN Users AS u on u.id = countAns.uid

Enter Parameters

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