SELECT Input.BountySum, COUNT(1) Count_ FROM ( SELECT v.U...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  Input.BountySum,
  COUNT(1) Count_
FROM (
  SELECT
    v.UserId [User Link],
    SUM(v.BountyAmount) BountySum
  FROM Votes v
  WHERE v.VoteTypeId = 8 AND v.BountyAmount > 0
  GROUP BY v.UserId) AS Input
WHERE Input.BountySum < 100000
GROUP BY Input.BountySum
ORDER BY Input.BountySum

Enter Parameters

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