Q&A for professional and enthusiast programmers
-- remove count if you want to see actual missing id's select count(su.seqid) as [deleted questions] from (select row_number() over (order by id) as seqid from Posts p where p.posttypeid = 1) as su left join Posts p on p.id = su.seqid where p.id is null