Gaps in Posts.Id


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

SELECT prev_Id, Id, diff, CreationDate FROM 
(SELECT *, LAG(Id) OVER(ORDER BY Id) as prev_Id, Id - LAG(Id) OVER(ORDER BY Id) as diff
from PostsWithDeleted
) as t
where t.diff > 1
ORDER BY prev_Id

Enter Parameters

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