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:
- For example, such statements are not executed correctly.
- Select * from table where ID in (select ID from table limit);
- But as long as you add one more layer on the line. Such as:
- Select * from table where ID in (select t. C14>table limit)asT)
- This allows you to bypass the problem of the limit subquery query.
- 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:
- 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