Anton.Sandbox

1

Please login or register to vote for this query.

(click on this box to dismiss)

Language Learning

Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition

/* Count reputation to evaluate Gini
*/

;WITH UsersSample AS
(
  SELECT u.Id
  FROM Users u tablesample(1 percent)
  )
SELECT 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
GROUP BY u.Id, v.VoteTypeId
ORDER BY u.Id, v.VoteTypeId

Enter Parameters

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