mysql子查询不支持limit问题解决 This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME
如果sql语句中的子查询包含limit
例如: select * from a where id in (select id from b limit 3)
会报错:This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME
解决办法:
1、加一层子查询
例如:select * from a where name in (select k.name from (select name from b limit 2 )as k)
2、把限制条件放到from而非where子句中,就不必出现嵌套再嵌套。
例如:select * from (select id from a limit 4) as foo
》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
欢迎访问本人博客=》》http://www.top8488.top 更多开发,大数据技能包,项目和工作经验及资源分享!!!
》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》