Copy Editor Progress

9

Please login or register to vote for this query.

(click on this box to dismiss)

This query returns the number of edits you still need to get the Copy Editor badge.

Artificial Intelligence Meta

Q&A about the site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment

-- Copy Editor Progress
-- This query returns the number of edits you still need to
-- get the Copy Editor badge.

DECLARE @userid int = ##UserId##

SELECT 500 - COUNT(*) AS EditsLeft
FROM (
    SELECT   PostID
    FROM     PostHistory ph
    WHERE    PostHistoryTypeId IN (4,5)
        AND  PostId NOT IN (
            SELECT p.Id
            FROM   Posts p
            WHERE  p.OwnerUserId = ph.UserId
        )
        AND UserID = @userid
    GROUP BY PostID
) AS bar

Enter Parameters

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