前言
Limit分页通用方案
select * from yundou_v3.bill_info limit 100,20;
select * from yundou_v3.bill_info limit 400000,20;
select * from yundou_v3.bill_info limit 600000,20;
select * from yundou_v3.bill_info limit 800000,20;
select * from yundou_v3.bill_info limit 1000000,20;
量级数据分页方案
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 100,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 400000,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 600000,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 800000,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 1000000,1
) limit 20;
原文地址:http://blog.51cto.com/phpme/2131433
时间: 2024-10-12 16:17:24