Q&A for professional and enthusiast programmers
-- Bounty Amount Received per User -- Questions where a user has received a Bounty Amount for their answer. Declare @userId int Set @UserId = ##UserId## Select COUNT(*) AS BountyCount, SUM(v.BountyAmount) AS TotalBountyAmmount, AVG(v.BountyAmount) AS AverageBountyAmmount From Votes v Join Posts p on v.PostId = p.Id Where v.VoteTypeId = 9 And p.PostTypeId = 2 And p.OwnerUserId = @UserId