select top 1 id from (
select top 9981 id from ttt order by id asc
) as a
order by id desc