Mysql-this version of MySQL doesn ' t yet support ' LIMIT & In/all/any/some Error Resolution

Source: Internet
Author: User


  when the national Day returned to the test, the use of nested queries in a MySQL expression, this error occurred. The reason is that the inner SELECT statement has a limit clause.   in the online search, there are articles that:
  1. For example, such statements are not executed correctly.
  2. Select * from table where ID in (select ID from table limit);
  3. But as long as you add one more layer on the line. Such as:
  4. Select * from table where ID in (select t. C14>table limit)asT)
  5. This allows you to bypass the problem of the limit subquery query.
  6. Problem solving.
later I found out that the above is a solution to the problem, in fact, there is a better way, is to put the constraints in the from rather than the WHERE clause, there is no need to have nested re-nesting. The above example can be replaced by:
    1. SELECT * FROM (SELECT id from table limit) as Foo;
Note: In fact, as Foo is particularly important, if it is not written in the form from () as XXX, that is, do not give the from after the SELECT statement form the table name, then the system will still error.

Mysql-this version of MySQL doesn ' t yet support ' LIMIT & In/all/any/some Error Resolution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.