Error Code: 1235. This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

来源:互联网 发布:瞬联软件 编辑:程序博客网 时间:2024/06/08 11:37
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子查询的问题。

0 0
原创粉丝点击