This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery异常解决方法

1.This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'的意思是,这版本的 MySQL 不支持使用 LIMIT 子句的 


select  * from (select order_id from sdb_b2c_order_items as sboi where sboi.source_name = 'etoneo2o')as t1 where t1.order_id in (select order_id from sdb_b2c_order_items_square as sbois) LIMIT 1000;

DELETE from sdb_b2c_order_items where order_id in (select  * from (select order_id from sdb_b2c_order_items as sboi where sboi.source_name = 'etoneo2o')as t1 where t1.order_id in (select order_id from sdb_b2c_order_items_square as sbois) LIMIT 1000);

 This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery异常解决方法

意思就是说MySQL不支持子查询

IN/ALL/ANY/SOME 子查询,即是支持非 IN/ALL/ANY/SOME 子查询的 LIMIT 子查询。

2.解决办法
*********再套一层就完美解决了**************

DELETE from sdb_b2c_order_items where order_id in (select order_id from (select  * from (select order_id from sdb_b2c_order_items as sboi where sboi.source_name = 'etoneo2o')as t1 where t1.order_id in (select order_id from sdb_b2c_order_items_square as sbois) LIMIT 1000)as t3)

结果:

DELETE from sdb_b2c_order_items where order_id in (select order_id from (select  * from (select order_id from sdb_b2c_order_items as sboi where sboi.source_name = 'etoneo2o')as t1 where t1.order_id in (select order_id from sdb_b2c_order_items_square as sbois) LIMIT 1000)as t3)
> Affected rows: 0
> 时间: 0.502s