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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla Meta

Q&A about the site for Joomla! administrators, users, developers and designers

-- Users with highest reputation-to-number-of-posts ratio
-- Shows users with at least @MinPosts answers.

DECLARE @MinPosts int = ##MinPosts##

SELECT TOP 200
  u.Id AS [User Link],
  count(*) AS NumPosts,
  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
GROUP BY u.Reputation, u.Id, u.DisplayName
HAVING count(*) >= @MinPosts
ORDER BY ratio DESC, NumPosts DESC

Enter Parameters

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