Bounty Investors (By % Rep Invested)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Inspired by http://meta.stackoverflow.com/a/307629/107591 I was interested in users who have given away large percentages of their reputation. So this tweaks the original query to do that, I had to exclude users with rep 1 because suspended users have rep 1 and skew the results otherwise

Stack Overflow

Q&A for professional and enthusiast programmers

select
 row_number() over (order by sum(v.BountyAmount) desc, u.Id)
,u.Id as [User Link]
,u.Reputation
,count(v.Id) as Bounties
,avg(v.BountyAmount) as [Average Spent]
,sum(v.BountyAmount) as [Total Spent]
,[Per] = 1.0 * sum(v.BountyAmount) / nullif(sum(v.BountyAmount) + u.Reputation, 0.0)
,[Percent of Rep Spent] = format(1.0 * sum(v.BountyAmount) / nullif(sum(v.BountyAmount) + u.Reputation, 0.0), 'p3')
from Users as u
  join Votes as v
  on v.UserId = u.Id
  and v.VoteTypeId = 8 -- bountystart
where u.Id > 0 
  -- Suspended accounts have rep 1 and will skew the results
  and u.Reputation != 1 
  -- If this is too low the numbers will skew towards people with 98%
  -- spend but very low overall rep (so of course their spend must be high)
  and u.Reputation > ##MinRep:int?1000## 
group by
 u.Id
,u.Reputation
order by
 [Per] desc
offset ##OffsetRows:int?0## rows
fetch next ##ReturnRows:int?10## rows only;

-- MinRep: Minimum reputation
-- OffsetRows: Number of rows to skip
-- ReturnRows: Number of rows to return

Enter Parameters

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