Users with highest reputation-to-number-of-posts ratio


Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

-- Users with highest reputation-to-number-of-answers ratio
-- Does not count self-answers. 
-- Shows users with at least @MinAnswers answers.

DECLARE @MinAnswers int = ##MinAnswers##

  u.Id AS [User Link],
  count(*) AS NumAnswers,
  u.Reputation AS Reputation,
  CAST(Reputation*1.0/count(*) AS DECIMAL(5,2)) AS ratio
FROM Posts a
INNER JOIN Users u ON u.Id = a.OwnerUserId
INNER JOIN Posts q ON a.ParentId = q.Id
  (q.OwnerUserId <> u.Id OR q.OwnerUserId IS NULL)   --no self answers
  AND a.PostTypeId = 2 -- answer
GROUP BY u.Reputation, u.Id, u.DisplayName
HAVING count(*) >= @MinAnswers
ORDER BY ratio DESC, NumAnswers DESC

Enter Parameters

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