首页 > 其他 > 详细

子查询中不能使用limit或者in

时间:2017-08-25 15:45:09      阅读:229      评论:0      收藏:0      [点我收藏+]

select * from  wechat_account_info  where id in(select id from wechat_account_info where groupId =‘8‘ ORDER BY id limit 15  ) as s

此句执行中会出现如下错误:

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

原因:

MYSQL子查询不支持limit

解决办法:

再次使用一层循环

select * from wechat_account_info where id in(
select id from (select id from wechat_account_info where groupId =‘8‘ ORDER BY id limit 15 ) as s )

子查询中不能使用limit或者in

原文:http://www.cnblogs.com/lccyongz/p/7428099.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!