1、Oracle select * from 表 where rownum >20 and rownum <=30
2、Mysql select * from 表 where limit >20 and limit <= 30
3、Sql server select top 10 * from 表 where id not in (select top 20 id from 表 order by id )order by id
一般数据库建表习惯都会加一个自增字段从1开始自增加1,这样的话很方便就可以查到你想要的!
select * from (select t1.*,rownum rn from (select * from table_name) t1 where rownum<=30)
where rn>=20;