举个栗子:
表名:batch_big_num
列名:id(主键),name,age,product_name,product_num
1,利用索引
(1)加一个order by+索引列 可以提升一定的效率
select * from batch_big_num order by id limit 100000,10;
(2)利用子查询
select n1.* from batch_big_num n1 inner join( select id from batch_big_num order by id limit 10000000, 20 )n2 using(id)
2,已知区间的的情况:
select * from batch_big_num where id between 10000000 and 10000020;
3,分两次查询
第一次 查出结果获得一个条件,比如id: select id from batch_big_num limit 20;
第二次 根据第一次查询出的结果查询:
select * from batch_big_num where id>n limit 20;