限制查询
我们通过limit可以限制返回结果的行数
select * from 表名 limit count;
select * from users limit 3;
指定从第几行起,返回多少行
select * from 表名 limit start,count;
select * from users limit 2,3;
相等
select * from users limit 3 offset 2;
取最大值
select * from users order by age desc limit 1;
取最小值
select * from users order by age asc limit 1;
分页
select * from users limit (page-1)*pageSize,pageSize;