In-depth analysis of limit usage in mysql
Select * from table limit m, n where m refers to the index at the beginning of the record, starting from 0, and n refers to taking n records starting from entry m.
Mysql (root @ localhost: test)> select * from total;
+ ---- + ----------------- + -------- + ------------ +
| Id | name | number | mydate |
+ ---- + ----------------- + -------- + ------------ +
| 1 | Henan press | 1000 | 2008-03-24 |
| 2 | Henan Publishing House | 1200 |
| 3 | Henan press | 1100 | 2010-04-24 |
| 4 | Henan Publishing House | 1400 |
| 5 | Henan press | 1350 | 2012-04-24 |
| 6 | Beijing press | 2000 |
| 7 | Beijing press | 2020 |
| 8 | Beijing press | 2050 | 2010-04-24 |
| 9 | Beijing press | 1980 |
| 10 | Beijing press | 2100 | 2012-04-24 |
+ ---- + ----------------- + -------- + ------------ +
10 rows in set (0.00 sec)
Mysql (root @ localhost: test)> select * from total limit 2, 3;
+ ---- + ----------------- + -------- + ------------ +
| Id | name | number | mydate |
+ ---- + ----------------- + -------- + ------------ +
| 3 | Henan press | 1100 | 2010-04-24 |
| 4 | Henan Publishing House | 1400 |
| 5 | Henan press | 1350 | 2012-04-24 |
+ ---- + ----------------- + -------- + ------------ +
3 rows in set (0.00 sec)
This is roughly the meaning.
BitsCN.com