select * from T where id not in( select top 200 Id from T order by id) and Id in( select top 500 Id from T order by Id) order by Id;