select * from mmo_db.c_sound t where t.id in (select m.id from (select * from mmo_db.c_sound union select * from mmo_db_v114.c_sound) m group by m.id having count(1) > 1);
--这个是正确的   可以查出东西来然后我要删除的时候  2种写法都不行,求助
delete from mmo_db.c_sound t where t.id in (select m.id from (select * from mmo_db.c_sound union select * from mmo_db_v114.c_sound) m group by m.id having count(1) > 1);
delete mmo_db.c_sound from mmo_db.c_sound t,(select m.id from (select * from mmo_db.c_sound union select * from mmo_db_v114.c_sound) m group by m.id having count(1) > 1)s where t.id = s.id;

解决方案 »

  1.   

    delete T from mmo_db.c_sound t 
    INNER JOIN 
    (select m.id from (select * from mmo_db.c_sound union select * from mmo_db_v114.c_sound) m group by m.id having count(1) > 1) T1
    ON t.id=T1.ID ;
      

  2.   

    delete t1 
    from mmo_db.c_sound t1  ,
    (select m.id from (select * from mmo_db.c_sound union select * from mmo_db_v114.c_sound) m group by m.id having count(1) > 1) t2
    where t1.id=t2.id;