查询A(ID,Name)表中第31至40条记录,ID作为主键可能是不是连续增长的列
select top 2 * from Students where id >(select max(id) from (select top 2 id from Students order by id ) T) order by id;
select top 2 * from Students where id not in (select top 2 id from Students);
7、查询A(ID,Name)表中第31至40条记录,ID作为主键可能是不是连续增长的列,完整的查询语句如下:
select top 10 * from A where ID >(select max(ID) from (select top 30 ID from A order by A ) T) order by A

浙公网安备 33010602011771号