[Err] 1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

IN/ALL/ANY/SOME 的子查询中用了limit关键词无法执行

1
select * from table\_example where  id in (select t.id from table\_example_b t limit 5)

这样执行会报错

1
_\[Err\] 1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'_

只需要在in里面在包一层select即可解决问题

1
select * from table\_example where  id in (select t.id (select id from table\_example_b limit 5) t)