Today in the processing of a movie site data, need to change part of the content, because this site has too many movies, a piece of processing is very difficult, so want to start from a part of the analysis, and then use to limit. At this time the MySQL error:
This version of the MySQL doesn ' t yet support ' LIMIT & in/all/any/some subquery '
The literal meaning is that the limit keyword is not supported for use in subqueries.
After searching, we found an alternative solution.
is to add a layer of subqueries to the limit of the subquery.
Like what:
The SQL statement that could have been an error was: Select *from cidy where ID in (select ID from cidy limit 0,10);
The modified SQL is: Select *from cidy where ID in (SELECT ID from (SELECT ID from Cidy limit 0,10));
Tested, modified SQL statement execution times error: Every derived table must have its own alias
The literal meaning of the error is: Need alias
From the above SQL statement, we can see that the extra layer of SQL not only has no alias, no table name, will it be a problem here? The test will know
The modified SQL statement is: SELECT *from cidy where ID in (SELECT ID from (SELECT ID from Cidy limit 0,10) as CD);
After testing, as we thought, finally succeeded.