Weighted Score of more 'successful' users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Tries to gauge success by weighting number of answers by acceptance percentage. This is done as a way to weed out people who post very infrequently, but are accepted often (counter productive perhaps, but too cautious for my likes).

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @MinAnswers int = ##MinAnswers##

SELECT TOP 100
  u.Id AS [User Link],
  count(*) AS NumAnswers,
  sum(case when q.AcceptedAnswerId = a.Id then 1 else 0 end) AS NumAccepted,
  (sum(case when q.AcceptedAnswerId = a.Id then 1 else 0 end)*100.0/(count(*))) AS AcceptedPercent,
  sum(case when q.AcceptedAnswerId = a.Id then 1 else 0 end)*(sum(case when q.AcceptedAnswerId = a.Id then 1 else 0 end)*100.0/(count(*)))/100 as WeightedScore
FROM Posts a
INNER JOIN Users u ON u.Id = a.OwnerUserId
INNER JOIN Posts q ON a.ParentId = q.Id
WHERE 
  (q.OwnerUserId <> u.Id OR q.OwnerUserId IS NULL)  --no self answers
  AND u.Reputation >=10000
GROUP BY u.Id
HAVING count(*)>@MinAnswers
ORDER BY WeightedScore DESC, AcceptedPercent DESC, NumAnswers DESC

Enter Parameters

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