mysql:
select * from tb_item limit 0, 5; 从offset=0开始取5条数据
select * from tb_item limit 5,5;从offset=5开始,取5条数据。
oracle:
步骤一:select * from tpr_users where rownum <= 40; 取40条之前的数据。
步骤二:select a.*, rownum rn from ( select * from tpr_users where rownum <= 40) a ;给40条数据使用rn字段 编号
步骤三:select * from (select a.*, rownum rn from ( select * from tpr_users where rownum <= 40) a ) where rn >20; 根据步骤二的编号顺序,获取20-40之间的数据。