sand_box

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP(100) p.Id AS [Post Link],
                rtrt.Name AS [Review Task Result Name],
                rtr.CreationDate [Date from Review Task Result],
                ROW_NUMBER() OVER(PARTITION BY p.Id ORDER BY rtr.Id ASC) AS [Sequence] 
FROM PostsWithDeleted p
INNER JOIN ReviewTasks rt ON rt.PostId = p.Id
INNER JOIN ReviewTaskResults rtr ON rtr.ReviewTaskId = rt.Id
INNER JOIN ReviewTaskResultTypes rtrt ON rtrt.Id = rtr.ReviewTaskResultTypeId
WHERE rt.ReviewTaskTypeId = 2 -- Close Votes review queue
      AND rt.ReviewTaskStateId = 2 -- Review was completed
      AND rtr.ReviewTaskResultTypeId IN (5, 6, 8) -- Edit, Close, Do not close; respectively
      AND p.CreationDate < GETDATE() - 15
      AND p.Id = 931762
ORDER BY p.Id DESC,
         rtr.Id ASC;

Enter Parameters

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