当数据量过大时,在一页中查看数据是一件非常麻烦的事情
语法:
select * from 表名 limit start,count
说明:
- 从start开始,获取count条数据
例子:查询前三行男生的信息
mysql> select * from school_student where sex='男' limit 0,3;
+------+------+------+------+
| id | name | age | sex |
+------+------+------+------+
| 1 | a | 20 | 男 |
| 2 | b | 21 | 男 |
| 5 | e | 24 | 男 |
+------+------+------+------+
3 rows in set (0.00 sec)
mysql> select * from school_student;
+------+------+------+------+
| id | name | age | sex |
+------+------+------+------+
| 1 | a | 20 | 男 |
| 2 | b | 21 | 男 |
| 3 | c | 22 | 女 |
| 4 | d | 23 | 女 |
| 5 | e | 24 | 男 |
+------+------+------+------+
5 rows in set (0.00 sec)

被折叠的 条评论
为什么被折叠?



