Top users by average answer score

1

Please login or register to vote for this query.

(click on this box to dismiss)

List the top users by average score (upvotes - downvotes) on answers

Stack Overflow

Q&A for programmers

-- Top users by average answer score
-- List the top users by average score (upvotes - downvotes) on answers

DECLARE @MinimumAnswerCount Numeric = 10

SELECT TOP 100
  p.OwnerUserId As [User Link],
  Min(u.Reputation) As [Reputation],
  Count(*) As [Number of answers],
  Round(Avg(Convert(Float, p.Score)), 2) As [Average score]
FROM Posts p
INNER JOIN Users u ON p.OwnerUserId = u.Id
WHERE p.PostTypeId = 2
  AND p.CommunityOwnedDate IS NULL
GROUP BY p.OwnerUserId
HAVING Count(*) >= @MinimumAnswerCount
ORDER BY [Average score] DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached