在一个Mysql表达式中使用嵌套查询,出现了这个错误。原因是内层select语句带有limit子句。
 
在网上查了下,有文章指出:

比如这样的语句是不能正确执行的。

select * from table where id in (select id from table limit 12);

但是,只要你再加一层就行。如:

select * from table where id in (select t.id from (select * from table limit 12)as t)

这样就可以绕开limit子查询的问题。

问题解决。

后来我发现,上述是解决问题的一个方法,其实还有一个更好的做法,就是把限制条件放到from而非where子句中,就不必出现嵌套再嵌套。
如上例,可以改为:

select * from (select id from table limit 12) as foo;

注意:其实as foo特别重要,如果不写成from () as xxx的形式,即不给from后的select语句构成表名,那么最后系统仍会报错。

This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME 错误解决的更多相关文章

  1. Mysql:Error Code 1235,This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME 错误解决

    This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME 错误解决 这次国庆节回来后的测试中,在一个Mysql表达式 ...

  2. Mysql:This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME 错误解决

    From: http://blog.chinaunix.net/uid-22414998-id-2945656.html This version of MySQL doesn’t yet suppo ...

  3. mysql-This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME 错误解决

      这次国庆节回来后的测试中,在一个Mysql表达式中使用嵌套查询,出现了这个错误.原因是内层select语句带有limit子句.   在网上查了下,有文章指出: 比如这样的语句是不能正确执行的. s ...

  4. This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery 解决方法

    This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'的意思是,这版本的 MySQL 不支持使 ...

  5. This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' 解决办法

    背景:mysql5.1.36,mybatis 前言:为了解决一对多,分页显示,但是前端主要是显示的一的一方的数据和(多方的某个字段拼接在一起),此时的limit不能直接跟在查询的后面,需要用子查询把需 ...

  6. MySQL----This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery

    This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'的意思是,这版本的 MySQL 不支持使 ...

  7. Mysql:1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'错误解决

    select distinct b.sale_count from product_sale b where b.pro_id in (select a.pro_id from product a L ...

  8. This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery

    This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'的意思是,这版本的 MySQL 不支持使 ...

  9. sql执行报错--This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

    问题: 不支持使用 LIMIT 子句的 IN/ALL/ANY/SOME 子查询,即是支持非 IN/ALL/ANY/SOME 子查询的 LIMIT 子查询. 解决: 将语句:select * from ...

随机推荐

  1. opencv显示鼠标所在位置的rgb值

    #include"highgui.h" #include"cv.h" #include"cxcore.h" #include<stdl ...

  2. SQLite的介绍 操作Sqlite 具体实例

    1.SQLite简介 SQLite是一款轻型的数据库,是遵守ACID的关联式数据库管理系统,它的设计目标是嵌入  式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能 ...

  3. SpringMVC上传文件以流方式判断类型附常用类型

    // 此类中判断类型所截取的byte 长度暂不确定,请使用者测试过使用 package com.tg.common.other; import com.tg.common.tginterface.TG ...

  4. hibernate学习笔记6--Criteria查询方式、完整小练习(开发步骤)

    一.Criteria查询方式没有sql语了,因此更加面向对象一些.Criteria是一种比HQL更面向对象的查询方式:Criteria的创建方式: Criteria c = s.createCrite ...

  5. 转载 近期微博吐槽言论存档,涉及“性能优化”、C++陋习等

    http://blog.csdn.net/solstice/article/details/9923615 近期微吐槽博言论存档,涉及“性能优化”.C++陋习等 写C++程序的几个陋习:class 名 ...

  6. 安装SQL2008的时候 出现System.Configuration.ConfigurationErrorsException: 创建 userSettings/Microsoft.SqlServe

    System.Configuration.ConfigurationErrorsException: 创建 userSettings/Microsoft.SqlServer.Configuration ...

  7. poj2942 Knights of the Round Table 双连通分支 tarjan

    题解:http://blog.csdn.net/lyy289065406/article/details/6756821 讲的很详细我就不多说了. 题目连接:http://poj.org/proble ...

  8. 点滴积累【JS】---JS小功能(createElement和insertBefore添加div下面的节点)

    效果: 代码: <head runat="server"> <title></title> <script type="text ...

  9. Jquery源码中的Javascript基础知识(三)

    这篇主要说一下在源码中jquery对象是怎样设计实现的,下面是相关代码的简化版本: (function( window, undefined ) { // code 定义变量 jQuery = fun ...

  10. [转载]initwithcoder和 initwithframe

    大前提是UIViewController有一个UIView.同时,需要厘清两个概念,创建一个类和实例化一个类.在XCode中创建一个类和实例化一个类很容易区分,但是在IB(Interface Buil ...