How much I gained through bounties

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for 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

Enter Parameters

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