我就想知道     limit的第二个参数 到底可不可以为 -1
   limit 10,-1  是不是能查出从10到最后一条   网上的帖子都说可以, 但是在客户端测试确实不行
     高手请给出确切答案 
    

解决方案 »

  1.   

    -1报语法错误
    mysql> select * from test1 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' at line 1
      

  2.   

      那 ibatis 执行这样的语句 会有  preparedStatement 么? 但是实际项目中确实能够成功  是什么原因
      但是网上的帖子通篇的说可以
      

  3.   

    不能,你测试的结果不是证明了?
    mysql> select * from employee limit 3,-1; 
    ERROR 1064 (42000): You have an error in your SQL syntax
    corresponds to your MySQL server version for the right s
    t line 1
      

  4.   

        在ibatis 中 如果用的jdbc连接池 是mysql-connector-java-3.1.11-bin.jar 确实可以成功 
        而且如果用的连接池为mysql-connector-java-5.1.18-bin.jar 就不行 而且就算语句为 select * from A limit #start#, #limit# 这个语句在两个连接池下面运行的结果都不同 ,按道理说不会出现这种情况的吧
      

  5.   

    Microsoft Windows XP [版本 5.1.2600]
    (C) 版权所有 1985-2001 Microsoft Corp.C:\Documents and Settings\Administrator>telnet 127.0.0.1 3306
    正在连接到127.0.0.1...不能打开到主机的连接, 在端口 3306: 连接失败C:\Documents and Settings\Administrator>netstat -aActive Connections  Proto Local Address Foreign Address State
      TCP PC-201112191208:epmap PC-201112191208:0 LISTENING
      TCP PC-201112191208:microsoft-ds PC-201112191208:0 LISTENING
      TCP PC-201112191208:912 PC-201112191208:0 LISTENING
      TCP PC-201112191208:1025 PC-201112191208:0 LISTENING
      TCP PC-201112191208:netbios-ssn PC-201112191208:0 LISTENING
      TCP PC-201112191208:1033 210.29.192.20:http CLOSE_WAIT
      TCP PC-201112191208:netbios-ssn PC-201112191208:0 LISTENING
      TCP PC-201112191208:1064 220.181.111.147:http CLOSE_WAIT
      TCP PC-201112191208:1065 domain.not.configured:http ESTABLISHED
      TCP PC-201112191208:1066 a63-80-242-40.deploy.akamaitechnologies.com:http
      ESTABLISHED
      TCP PC-201112191208:1067 123.125.114.101:http CLOSE_WAIT
      TCP PC-201112191208:epmap PC-201112191208:0 LISTENING 0
      UDP PC-201112191208:microsoft-ds *:*
      UDP PC-201112191208:1035 *:*
      UDP PC-201112191208:ntp *:*
      UDP PC-201112191208:1063 *:*
      UDP PC-201112191208:1071 *:*
      UDP PC-201112191208:1900 *:*
      UDP PC-201112191208:ntp *:*
      UDP PC-201112191208:netbios-ns *:*
      UDP PC-201112191208:netbios-dgm *:*
      UDP PC-201112191208:1900 *:*
      UDP PC-201112191208:ntp *:*
      UDP PC-201112191208:1900 *:*
      UDP PC-201112191208:ntp *:*
      UDP PC-201112191208:netbios-ns *:*
      UDP PC-201112191208:netbios-dgm *:*
      UDP PC-201112191208:1900 *:*在打开MySQL Workbench  SQL development 直面的东西也会出现127.0.0.1   (10061)问题,我每次重装xp系统就好,但是不久就出现上述问题了,求大神忙下忙。谢谢!
      

  6.   

    我弄好了  是ipv6的问题   我直接卸载的     网上说也可以改host文件     在127.0.0.1后面直接添加localhost    我没找到host文件在哪里   有知道的吗
      

  7.   

    MYSQL本身都不行,这不是找罪受嘛
      

  8.   

    老师刚讲了这个limit  不能的