Users by total bounty given

0

Please login or register to vote for this query.

(click on this box to dismiss)

Returns, for each user, the total amount of reputation offered as bounty, the number of bounties offered, and current reputation, ordered by the total reputation offered.

スタック・オーバーフローMeta

プログラマーと熱狂的なプログラマーのためのサイトに関する質問と回答

SELECT
  Votes.UserId AS [User Link],
  SUM(Votes.BountyAmount) AS BountyTotal,
  COUNT(Votes.BountyAmount) AS BountyNumber,
  MAX(Users.Reputation) AS Reputation,
  SUM(Votes.BountyAmount)+MAX(Users.Reputation) 
     AS 'rep plus bounties',
  100*SUM(Votes.BountyAmount)/(SUM(Votes.BountyAmount)+MAX(Users.Reputation))
     AS '% rep given',
  SUM(Votes.BountyAmount)/COUNT(Votes.BountyAmount)
     AS 'Avg bounty rep',
  100*COUNT(CASE WHEN Votes.UserId = questions.OwnerUserId THEN 1 END)/COUNT(Votes.BountyAmount)
     AS '% own Q',
  COUNT(CASE WHEN Votes.UserId = questions.OwnerUserId THEN 1 END) 
     AS 'No. own Q'
FROM
  Votes
  INNER JOIN Users ON Votes.UserId = Users.Id
  LEFT JOIN Posts questions ON Votes.PostId = questions.Id
WHERE
  Votes.VoteTypeId = 8 --BountyStart
  AND Votes.UserId > -1 --Remove Community user
  AND Users.Reputation > ##MinReputation?1##
GROUP BY
  Votes.UserId,
  Users.Id
HAVING 
  COUNT(Votes.BountyAmount) >= ##MinBountyNo?1##
ORDER BY
  BountyNumber DESC

Enter Parameters

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