delete from zb where id in (select id from zb group by prd_name,mf_cmp_name,info having count(id) > 1) and
id not in (select min(id) from zb group by prd_name,mf_cmp_name,info having count(id) > 1);求解答!!! 

解决方案 »

  1.   

    此类错误是这样的,
    产生矛盾了,还句话讲,
    有的id既在in里面,又在not in里面,
    建议你用排除法。
    说到底,是你的二个select 未控制好。
      

  2.   

    这种联合的在mysql里面最好还是分步来  不要一步搞完
      

  3.   

    delete a from zb a inner join (select id from zb group by prd_name,mf_cmp_name,info having count(id) > 1) b on a.id=b.id
    left join (select min(id) as id from zb group by prd_name,mf_cmp_name,info having count(id) > 1) c on a.id=c.id
    where c.id is null
      

  4.   

    delete a1 from zb a1 inner join 
    (select id from zb group by prd_name,mf_cmp_name,info having count(id) > 1) c1 
    on a1.id=c1.id
    left join 
    (select min(id) as mid from zb group by prd_name,mf_cmp_name,info having count(id) > 1) d1 
    on a1.id=d1.mid where d1.mid is null
      

  5.   

    http://verysimple.com/2011/03/30/mysql-cant-specify-target-table-for-update-in-from-clause/解决方案。