根本不抖

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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 )

posted on 2017-08-25 15:02  根本不抖  阅读(975)  评论(0编辑  收藏  举报