Users with the most rep-gaining answer acceptances

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- Enter Query Title
-- Enter Query Description

SELECT TOP 100
    u.Id AS [User Link],
    u.Reputation,
    (
        SELECT COUNT(*) FROM Posts q
            WHERE
                q.OwnerUserId = u.Id AND
                q.PostTypeId = 1
    ) AS 'All Questions',
    (
        SELECT COUNT(*) FROM Votes v
            INNER JOIN Posts a ON a.Id = v.PostId
            INNER JOIN Posts q ON q.Id = a.ParentId
            WHERE
                q.OwnerUserId = u.Id AND
                v.VoteTypeId = 1 AND
                q.OwnerUserId != a.OwnerUserId AND
                (q.CommunityOwnedDate IS NULL OR q.CommunityOwnedDate > v.CreationDate)
    ) AS 'Rep-gaining Acceptances'
FROM Users u
ORDER BY 'Rep-gaining Acceptances' DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached