Top Bounty Earners of a Specific Tag on StackOverflow

1

Please login or register to vote for this query.

(click on this box to dismiss)

Chess

Q&A for serious players and enthusiasts of chess

-- Created by aminography [https://stackoverflow.com/users/1631967/aminography]

SELECT TOP ##Top:int?100## 
    ROW_NUMBER() OVER(ORDER BY SUM(Votes.BountyAmount) DESC) AS [Rank],
    Users.Id AS [User Link],
    COUNT(Votes.Id) AS [Bounty Count],
    SUM(Votes.BountyAmount) AS [##Tag?android## Earned Bounty],
    Users.Reputation AS [Total Reputation]
    
FROM Users 
    INNER JOIN Posts ON Users.Id = Posts.OwnerUserId
    INNER JOIN PostTags ON PostTags.PostId = Posts.ParentId
    INNER JOIN Votes ON Votes.PostId = Posts.Id
    INNER JOIN Tags ON Tags.Id = PostTags.TagId

WHERE Posts.PostTypeId = 2 AND            -- Answer
    Posts.CommunityOwnedDate IS NULL AND  -- Non-Community
    Votes.VoteTypeId = 9   AND            -- BountyClose
    Tags.TagName = '##Tag##'              -- Tag Name

GROUP BY Users.Id, Users.Reputation

ORDER BY CASE Users.Id WHEN ##TargetUserId:int?0## THEN 1 ELSE 0 END DESC,
    [##Tag## Earned Bounty] DESC

Enter Parameters

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