List all locked posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lists all currently locked posts, most recent first.

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

SELECT p.Id                AS [Post Link],
       MAX(h.CreationDate) AS [Locked Date]
FROM   Posts p
       INNER JOIN PostHistory h
         ON h.PostId = p.Id
WHERE  h.PostHistoryTypeId IN (14, 15) -- locked, unlocked
GROUP  BY p.Id
HAVING SUM(CASE WHEN h.PostHistoryTypeId = 14 THEN 1 ELSE -1 END) > 0 -- locked more often than unlocked

Enter Parameters

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