Edits by user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Displays a summary of edits per user

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

-- Edits by user
-- Displays a summary of edits per user

Declare @UserId int = ##UserId##

SELECT TOP 50
    Id AS [User Link],
    (
        SELECT COUNT(*) FROM Posts
        WHERE
            PostTypeId = 1 AND
            LastEditorUserId = Users.Id AND
            OwnerUserId != Users.Id AND
            Users.Id = @UserId        
    ) AS QuestionEdits,
    (
        SELECT COUNT(*) FROM Posts
        WHERE
            PostTypeId = 2 AND
            LastEditorUserId = Users.Id AND
            OwnerUserId != Users.Id AND
            Users.Id = @UserId
    ) AS AnswerEdits,
    (
        SELECT COUNT(*) FROM Posts
        WHERE
            LastEditorUserId = Users.Id AND
            OwnerUserId != Users.Id AND
            Users.Id = @UserId
    ) AS TotalEdits
    FROM Users
    ORDER BY TotalEdits DESC

Enter Parameters

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