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;
解决方案 »
- 一个表中有type ,numberData两个字段, type存的是类别,numberData,存的是正数,负数和0,我现在查出 numberData里>=0
- C++动态执行SQL语句问题
- 看看这个存储过程错哪了?
- mysql重命名库名怎么操作?
- 高手::对于MYSQL数据库我一点也不熟,只会用SQL 2000, 现有一个项目需要用ASP+MYSQL,需求请教高手,必有重谢!
- 请问大家 mysql 哪个版本比较稳定?5.0怎么样?
- 怎样将Sql Server中的数据转换到My Sql 中?
- 多表排序sql
- MySQL5.6安装:visual studio tools for office 2010 runtime
- 那里有工具将SQL sever的数据库转换成MySQL的??求救啊……
- mysql存储过程 游标
- Linux下mysql中:如何把character_set_system编码修改为gbk
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 ;
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;