BountifulII

2

Please login or register to vote for this query.

(click on this box to dismiss)

This report lists all the bounties offered and earned. It differentiates between bounties offered on questions that the bounty-supplier owns (Self) or does not own (Promotes).

Code Review

Q&A for peer programmer code reviews

WITH Bounties AS (
    SELECT
       UserID AS UserID,
       0 AS GetCount,
       0 AS GetAmount,
       COUNT(BountyAmount) AS GiveCount,
       SUM(BountyAmount) AS GiveAmount
    FROM votes
    WHERE VoteTypeId = 8
    GROUP --firewall fix
    BY UserID
   UNION
    SELECT
       Posts.OwnerUserID AS UserID,
       COUNT(BountyAmount) AS GetCount,
       SUM(BountyAmount) AS GetAmount,
       0 AS GiveCount,
       0 AS GiveAmount
    FROM Votes,
         Posts
    WHERE Votes.PostId = Posts.ID
      AND VoteTypeId = 9
    GROUP --firewall fix
    BY Posts.OwnerUserID
  ) 

SELECT UserID AS [User Link],
       SUM(GetCount) AS GetCount,
       SUM(GetAmount) AS GetAmount,
       SUM(GiveCount) AS GiveCount,
       SUM(GiveAmount) AS GiveAmount
FROM Bounties
GROUP -- firewall fix
BY UserID

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results