1235 - This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’
MySQL5.1中子查询是不能使用LIMIT的,
会报错: “This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’ ”
比如这样的语句是不能正确执行的。
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子查询的问题。
参考资料:
1、LIMIT & IN/ALL/ANY/SOME subquery
https://blog.youkuaiyun.com/lanpy88/article/details/7094387
2、MySQL报错:This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME
https://blog.youkuaiyun.com/u012161134/article/details/51393816
3、MySQL - This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery
https://stackoverflow.com/questions/17892762/mysql-this-version-of-mysql-doesnt-yet-support-limit-in-all-any-some-subqu