Users with the highest rep to total posts ratio

1

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 TOP 50
   u.Id,
   u.DisplayName,
   u.Reputation,
   n.NumPosts as [Total Number of Posts],
   cast(u.Reputation as decimal)/n.NumPosts as Ratio
FROM Users u
inner join (
   select
      p.OwnerUserId,
      count(*) as NumPosts
   from Posts p
   where p.PostTypeId in (1,2)
   group by p.OwnerUserId
   having count(*) >= ##MinPosts?10##
   ) n on n.OwnerUserId = u.Id
ORDER BY Ratio DESC

Enter Parameters

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