取出sql表中第31到40条的记录(以自动增长ID为主键):
Sql Server 下:
方案1:select top 10 * from t where id not in (select top 30 id form t order by id) order by id;
方案2:select top 10 * from t where id in (select top 40 id from t order by id) order by id desc;
MySql 下:
select * from t order by id limit 30,10;
Oracle 下:
select * from (select rownum r,* from t where r<40) where r>30;
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/13387.html