这两句SQL语句的执行结果是一样的不知道怎么回事数据库:mysql5.0select pid from cdb_posts limit 0,10;
+-----+
| pid |
+-----+
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 101 |
| 102 |
+-----+select pid from cdb_posts limit 5,10;
+-----+
| pid |
+-----+
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 101 |
| 102 |
+-----+不知道何故
如何解决!
网上找了很多的资料
都是关于优化的
加了order by 结果还是一样mysql> select pid from cdb_posts order by tid desc limit 5,10;
+-----+
| pid |
+-----+
| 183 |
| 182 |
| 181 |
| 180 |
| 179 |
| 178 |
| 177 |
| 176 |
| 188 |
| 189 |
+-----+
10 rows in set
+-----+
| pid |
+-----+
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 101 |
| 102 |
+-----+select pid from cdb_posts limit 5,10;
+-----+
| pid |
+-----+
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 101 |
| 102 |
+-----+不知道何故
如何解决!
网上找了很多的资料
都是关于优化的
加了order by 结果还是一样mysql> select pid from cdb_posts order by tid desc limit 5,10;
+-----+
| pid |
+-----+
| 183 |
| 182 |
| 181 |
| 180 |
| 179 |
| 178 |
| 177 |
| 176 |
| 188 |
| 189 |
+-----+
10 rows in set
原来是我自己错了
limit的基本用法都不会谁要是来回复下
我就结帖了
MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html
http://www.lsffractal.com/post/17.html