mysql:删除查询不';不能使用子查询

mysql:删除查询不';不能使用子查询,mysql,Mysql,此查询执行永远不会结束 delete from commande where bl in ( select noBl from ( select distinct noBl,num_commande from T_VENTE) s group by noBl having count(*)>2 ); 我不明白,因为子查询 select noBl from ( select distinct noBl,num_commande fro

此查询执行永远不会结束

delete from commande where bl in (
    select noBl from (
        select distinct noBl,num_commande from T_VENTE) s
    group by noBl
    having count(*)>2
);
我不明白,因为子查询

select noBl from (
        select distinct noBl,num_commande from T_VENTE) s
    group by noBl
    having count(*)>2
需要一秒钟才能完成

列bl在表命令中被索引

如果有人有想法…

提前感谢

我不确定你取得了什么成就。你需要提供详细信息。
delete需要一个条件语句,如下所示

DELETE FROM customer1 WHERE agent_code=ANY(SELECT agent_code FROM agents WHERE working_area='London');
它是如何工作的


首先从代理表的代理代码中获取记录,然后使用结果执行删除操作。

您必须使用另一级子查询: 检查


子查询提供ID列表(noBl)。我需要从表命令中删除子查询id列表中包含id的记录。您需要创建过程
delete from commande where bl in (
    select noBl from (
        select noBl from (
            select distinct noBl,num_commande from T_VENTE) s
        group by noBl
        having count(*)>2
    ) as tmp
);