我希望能取1到无限的数据,请问如何做,谢谢了那就用不着limit了,直接SELECT o.orderno,o.date FROM orderr o where o.code='W0005'orderby date;. [align=center]====思想重于技巧==== [/align] . 贴子分数<20:对自已的问题不予重视。 贴子大量未结:对别人的回答不予尊重。 .
SELECT o.orderno,o.date FROM orderr o where o.code='W0005' and date> ###(第一条数据的 date) order by date
mysql> select * from test limit 1,3; +-------+------------+---------------------+ | id | name | time | +-------+------------+---------------------+ | 10005 | bbbbbbbbbb | 2008-07-17 09:24:21 | | 10006 | aaaaaaaaa | 2008-07-17 09:24:24 | | 10007 | ddddddddd | 2008-07-17 09:25:31 | +-------+------------+---------------------+ 3 rows in set (0.00 sec)mysql> select * from test limit 1,-1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' a t line 1以前知道也没试过,怎么会报错哪?
mysql> select * from test limit 1,-1;可以从1取到最后一条记录,我也验证过,可以实现!楼上的,你会不会是版本太低了!
select * from test limit 1,99999999999999999999999999999;
[align=center]==== 思想重于技巧 ====
[/align]
.
贴子分数<20:对自已的问题不予重视。
贴子大量未结:对别人的回答不予尊重。
.
如果是 limit 1,20;得到的记录应该是从第二条记录开始到最后一条的~
-1代表无限制到结尾
mysql> select * from test limit 1,3;
+-------+------------+---------------------+
| id | name | time |
+-------+------------+---------------------+
| 10005 | bbbbbbbbbb | 2008-07-17 09:24:21 |
| 10006 | aaaaaaaaa | 2008-07-17 09:24:24 |
| 10007 | ddddddddd | 2008-07-17 09:25:31 |
+-------+------------+---------------------+
3 rows in set (0.00 sec)mysql> select * from test limit 1,-1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '-1' a
t line 1以前知道也没试过,怎么会报错哪?