Q&A for experienced flyers, pilots, and builders of drones and model aircraft
SELECT p.Id, p.CreationDate, n.NextId - p.Id - 1 AS 'Missing post ID', CONCAT('site://posts/', p.Id + 1, '/revisions') AS 'First missing post' FROM Posts AS p CROSS APPLY ( SELECT MIN(Id) AS NextId FROM Posts WHERE Id > p.Id ) n WHERE n.NextId - p.Id != 1 AND (p.CreationDate >= '##Date1?2010-07-20##') AND (p.CreationDate <= '##Date2?2013-09-02##') ORDER BY p.CreationDate