1、limit用法
格式:select * from table limit num1, num2
num1: 跳过的行数
num2: 展示的行数
例:
select * from student limit 0,6 —— 取student表的前6条数据
select * from student limit 6 —— 取student表的前6条数据
select * from student limit 2,6 —— 取student表,跳过2行,从第3条开始取6条数据,3、4、5、6、7、8
select * from student limit 6,-1—— 取student表的第7条-最后一行数据
2、limit与offset结合用法
格式:select * from table limit n offset m
m: 跳过的行数
n: 展示的行数
select * from student limit 6 offset 2——取student表,跳过2行,从第3条开始取6条数据,3、4、5、6、7、8