mysql에서 limit 사용법

select * from table limit m,n  m       index, 0  ,n    m   , n 。

대체로 이런 뜻이다.
mysql(root@localhost:test)>select * from total;
+----+-----------------+--------+------------+
| id | name            | number | mydate     |
+----+-----------------+--------+------------+
|  1 |            |   1000 | 2008-03-24 |
|  2 |            |   1200 | 2009-04-24 |
|  3 |            |   1100 | 2010-04-24 |
|  4 |            |   1400 | 2011-04-24 |
|  5 |            |   1350 | 2012-04-24 |
|  6 |            |   2000 | 2008-03-24 |
|  7 |            |   2020 | 2009-04-24 |
|  8 |            |   2050 | 2010-04-24 |
|  9 |            |   1980 | 2011-04-24 |
| 10 |            |   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 |            |   1100 | 2010-04-24 |
|  4 |            |   1400 | 2011-04-24 |
|  5 |            |   1350 | 2012-04-24 |
+----+-----------------+--------+------------+
3 rows in set (0.00 sec)

좋은 웹페이지 즐겨찾기