Batting average

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

DECLARE @MinAnswers int = ##MinAnswers##

SELECT TOP 20
  p.OwnerUserId,
  u.DisplayName,
  u.Reputation,
  AVG(p.Score) AS AverageScore,
  COUNT(*) AS AnswerCount
FROM Posts p
INNER JOIN Users u ON p.OwnerUserId = u.Id
WHERE p.PostTypeId = 2
  AND p.DeletionDate IS NULL
  AND p.OwnerUserId IS NOT NULL
GROUP BY p.OwnerUserId, u.DisplayName, u.Reputation
HAVING count(*) >= @MinAnswers
ORDER BY AVG(p.Score) DESC;

Enter Parameters

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