Bounties by reputation groups

1

Please login or register to vote for this query.

(click on this box to dismiss)

MathOverflow

Q&A for professional mathematicians

;with repgroups_cte AS (
SELECT
  Id AS uid,
  CAST(reputation/##rep## AS int) AS rep
  FROM Users
), bts_cte AS (
SELECT bs.PostId, rg.rep AS rep, bs.BountyAmount AS amo
FROM repgroups_cte rg INNER JOIN Votes bs ON rg.uid = bs.UserId
WHERE
 bs.VoteTypeId = 8  -- BountyStart
)

SELECT
  rep, COUNT(*), SUM(amo)
FROM bts_cte
GROUP BY rep
ORDER BY rep DESC

Enter Parameters

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