mysql查询语句通过limit来限制查询的行数

488 查看

mysql查询语句,通过limit来限制查询的行数。

例如:

select name from usertb where age > 20 limit 0, 1; //限制从第一条开始,显示1条

select name from usertb where age > 20 limit 1; //同上面的一个效果

select name from usertb where age > 20 limit 4, 1; //显示从第五条开始,显示1条