Users ranked by average answer score

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

-- Minimum number of answers a user must have written to be included.
DECLARE @MinAnswers int = ##MinAnswers##

SELECT
       TOP 100
       Users.Id AS [User Link],
       SUM(Posts.Score) AS "Total upvotes",
       COUNT(*) AS "Total answers",
       1.0 * SUM(Posts.Score) / COUNT(*) AS "Ave. score",
       MAX(Posts.Score) AS "Highest score",
       1.0 * MAX(Posts.Score) / SUM(Posts.Score) AS "Faction votes from highest"
FROM Posts LEFT JOIN Users
ON Posts.OwnerUserId = Users.Id
WHERE Posts.PostTypeId = 2
GROUP BY Users.Id
HAVING COUNT(*) >= @MinAnswers
ORDER BY "Ave. score" DESC

Enter Parameters

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