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.
Q&A for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors
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 '% rep given' DESC