mysql oracle sqlserver 数据库分页
mysql> use xyj;
Database changed
mysql> show tables;
+---------------+
| Tables_in_xyj |
+---------------+
| note |
| person |
| student |
| teacher |
+---------------+
4 rows in set (0.00 sec)
mysql> select * from teacher;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 1 | LXH01 | 李兴华01 | MLDN01 |
| 2 | LXH02 | 李兴华02 | MLDN02 |
| 3 | LXH03 | 李兴华03 | MLDN03 |
| 4 | LXH04 | 李兴华04 | MLDN04 |
| 5 | LXH05 | 李兴华05 | MLDN05 |
| 6 | LXH06 | 李兴华06 | MLDN06 |
| 7 | LXH07 | 李兴华07 | MLDN07 |
| 8 | LXH08 | 李兴华08 | MLDN08 |
| 9 | LXH09 | 李兴华09 | MLDN09 |
| 10 | LXH10 | 李兴华10 | MLDN10 |
| 11 | LXH11 | 李兴华11 | MLDN11 |
| 12 | LXH12 | 李兴华12 | MLDN12 |
| 13 | LXH13 | 李兴华13 | MLDN13 |
| 14 | LXH14 | 李兴华14 | MLDN14 |
| 15 | LXH15 | 李兴华15 | MLDN15 |
| 16 | LXH16 | 李兴华16 | MLDN16 |
| 17 | LXH17 | 李兴华17 | MLDN17 |
| 18 | LXH18 | 李兴华18 | MLDN18 |
| 19 | LXH19 | 李兴华19 | MLDN19 |
| 20 | LXH20 | 李兴华20 | MLDN20 |
| 21 | LXH21 | 李兴华21 | MLDN21 |
| 22 | LXH22 | 李兴华22 | MLDN22 |
| 23 | LXH23 | 李兴华23 | MLDN23 |
+----+-------+----------+----------+
23 rows in set (0.11 sec)
mysql> select * from teacher limit 2, 2;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 3 | LXH03 | 李兴华03 | MLDN03 |
| 4 | LXH04 | 李兴华04 | MLDN04 |
+----+-------+----------+----------+
2 rows in set (0.00 sec)
mysql> select * from teacher limit 20, 2;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 21 | LXH21 | 李兴华21 | MLDN21 |
| 22 | LXH22 | 李兴华22 | MLDN22 |
+----+-------+----------+----------+
2 rows in set (0.00 sec)
mysql> select * from teacher limit 20, 3;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 21 | LXH21 | 李兴华21 | MLDN21 |
| 22 | LXH22 | 李兴华22 | MLDN22 |
| 23 | LXH23 | 李兴华23 | MLDN23 |
+----+-------+----------+----------+
3 rows in set (0.00 sec)
mysql>
Database changed
mysql> show tables;
+---------------+
| Tables_in_xyj |
+---------------+
| note |
| person |
| student |
| teacher |
+---------------+
4 rows in set (0.00 sec)
mysql> select * from teacher;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 1 | LXH01 | 李兴华01 | MLDN01 |
| 2 | LXH02 | 李兴华02 | MLDN02 |
| 3 | LXH03 | 李兴华03 | MLDN03 |
| 4 | LXH04 | 李兴华04 | MLDN04 |
| 5 | LXH05 | 李兴华05 | MLDN05 |
| 6 | LXH06 | 李兴华06 | MLDN06 |
| 7 | LXH07 | 李兴华07 | MLDN07 |
| 8 | LXH08 | 李兴华08 | MLDN08 |
| 9 | LXH09 | 李兴华09 | MLDN09 |
| 10 | LXH10 | 李兴华10 | MLDN10 |
| 11 | LXH11 | 李兴华11 | MLDN11 |
| 12 | LXH12 | 李兴华12 | MLDN12 |
| 13 | LXH13 | 李兴华13 | MLDN13 |
| 14 | LXH14 | 李兴华14 | MLDN14 |
| 15 | LXH15 | 李兴华15 | MLDN15 |
| 16 | LXH16 | 李兴华16 | MLDN16 |
| 17 | LXH17 | 李兴华17 | MLDN17 |
| 18 | LXH18 | 李兴华18 | MLDN18 |
| 19 | LXH19 | 李兴华19 | MLDN19 |
| 20 | LXH20 | 李兴华20 | MLDN20 |
| 21 | LXH21 | 李兴华21 | MLDN21 |
| 22 | LXH22 | 李兴华22 | MLDN22 |
| 23 | LXH23 | 李兴华23 | MLDN23 |
+----+-------+----------+----------+
23 rows in set (0.11 sec)
mysql> select * from teacher limit 2, 2;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 3 | LXH03 | 李兴华03 | MLDN03 |
| 4 | LXH04 | 李兴华04 | MLDN04 |
+----+-------+----------+----------+
2 rows in set (0.00 sec)
mysql> select * from teacher limit 20, 2;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 21 | LXH21 | 李兴华21 | MLDN21 |
| 22 | LXH22 | 李兴华22 | MLDN22 |
+----+-------+----------+----------+
2 rows in set (0.00 sec)
mysql> select * from teacher limit 20, 3;
+----+-------+----------+----------+
| id | uid | name | password |
+----+-------+----------+----------+
| 21 | LXH21 | 李兴华21 | MLDN21 |
| 22 | LXH22 | 李兴华22 | MLDN22 |
| 23 | LXH23 | 李兴华23 | MLDN23 |
+----+-------+----------+----------+
3 rows in set (0.00 sec)
mysql>