首页 > 数据库技术 > 详细

mysql limit的使用方法

时间:2019-08-21 12:48:52      阅读:110      评论:0      收藏:0      [点我收藏+]
mysql的分页limit的使用方法大全
1.取表中的n行之后的m条元组(limit n,m)
select * from student limit 4,8; //取出student表中第4行后的8条元组(这里的区间是左开右闭)
2.取出表中前m行元素(limit m)
select * from student limit 3; //取出student表中的前3行元组
3.取出某表某页中的元素
在某表中满足某一条件的元组集合我们认为是页。
<1>取页中的n行之后的m条元组(limit n,m)
select * from student where score>75 limit 2,2; //取出满足成绩大于75分的页中2行以后两条元组
<2>取页中的m条元组(limit m)
select * from student where score>75 limit 2; //取出满足成绩大于75分的页中前2行元组

 

mysql limit的使用方法

原文:https://www.cnblogs.com/FengZeng666/p/11387643.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!