Count reputation to evaluate SE Gini


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

/* Count reputation to evaluate SE Gini

;WITH UsersSample AS
  FROM Users u tablesample(1 percent)
SELECT u.Id as UserId, v.VoteTypeId, COUNT(*) as n
FROM Votes v
  RIGHT OUTER JOIN Posts p ON p.Id = v.PostId
  RIGHT OUTER JOIN UsersSample u ON u.Id = p.OwnerUserId
  WHERE v.Id > 0 AND u.Id > 0 AND (v.VoteTypeId = 2 OR v.VoteTypeId = 3)
GROUP BY u.Id, v.VoteTypeId
ORDER BY u.Id, v.VoteTypeId

Enter Parameters

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