Altruists

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select 
--count(*)   --totals
top 20 *   --info
from
(
  select 
    v.UserId, 
    max(u.DisplayName) as DisplayName, 
    sum(BountyAmount) as TotalBountyAmount, 
    count(*) as BountyCount,
    avg(BountyAmount) as AvgBounty
  from 
    Votes v
    join Posts p on p.Id = v.PostId
    join Users u on u.Id = v.UserId
  where 
    BountyAmount > 0 
    -- altruistic bounties only
    and p.OwnerUserId != v.UserId
    -- exclude Community
    and u.Id != -1
  group by UserId
  having count(*) >= 20
) U
order by TotalBountyAmount desc

Enter Parameters

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