**
分页操作
**
limit start,count
限制查询出来的数据格式
select * from students where gender=1 limit 2;
查询前5个数据
select * from students limit 0,5;
查询id6-10(包含)的书序
select * from students limit 5,5;
每页显示2个,第1个页面
select * from students limit 0,2;
每页显示2个,第2个页面
select * from students limit 2,2;
每页显示2个,第3个页面
select * from students limit 4,2;
每页显示2个,第4个页面
select * from students limit 6,2; – -----> limit (第N页-1)每页的个数, 每页的个数;每页显示2个,显示第6页的信息, 按照年龄从小到大排序select * from students order by age asc limit 10,2;select * from students where gender=2 order by age desc limit 0,2;失败select * from students limit 2(6-1),2;
失败select * from students limit 10,2 order by age asc;
注:limit 需放在最后
————————————————
版权声明:本文为CSDN博主「HXH.py」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_44850984/article/details/89918791