Top 1000 Answer Authors of a Specific Tag on StackOverflow

1

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

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

/* Note that in some cases the tag reputation exceeds the total reputation of 
   a user (e.g. CommonsWare in android tag). In these cases, they have subjected 
   to the daily reputation limitation of 200. 
   (https://stackoverflow.com/help/whats-reputation) */

SELECT TOP 1000 
    ROW_NUMBER() OVER(
        ORDER BY SUM(
            CASE
                WHEN Votes.VoteTypeId = 1 THEN 15                  -- AcceptedByOriginator
                WHEN Votes.VoteTypeId = 2 THEN 10                  -- UpMod
                WHEN Votes.VoteTypeId = 3 THEN -2                  -- DownMod
                WHEN Votes.VoteTypeId = 9 THEN Votes.BountyAmount  -- BountyClose
                ELSE 0                                             -- Other
            END
        )
    DESC) AS [Rank],
    Users.Id AS [User Link],
    SUM(
        CASE
            WHEN Votes.VoteTypeId = 1 THEN 15                  -- AcceptedByOriginator
            WHEN Votes.VoteTypeId = 2 THEN 10                  -- UpMod
            WHEN Votes.VoteTypeId = 3 THEN -2                  -- DownMod
            WHEN Votes.VoteTypeId = 9 THEN Votes.BountyAmount  -- BountyClose
            ELSE 0                                             -- Other
        END
    ) AS [##Tag?android## Reputation],
    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
    Tags.TagName = '##Tag##'              -- Tag Name

GROUP BY Users.Id, Users.Reputation

ORDER BY [##Tag## Reputation] DESC

Enter Parameters

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