select * from (select top n * from students) aa where not exists(select * from (select top n-1 * from students) bb where aa.id=bb.id)select