呵呵,最简单的做法就是查询一个表所有数据循环跟另一个表的比较还有一个就是直接联表查询, 比如select a,id,b.id from a,b where a.filed1=b.filed1 and a.filed2=b.filed2 and a.filed3=b.filed3这样查询然后删除了
1、取得 表A 的记录数备用 select count(*) as cnt from A 2、提取出与表A不同的表B的记录 select * from A union select * from B limit cnt 3、取得 表B 的记录数备用 select count(*) as cnt from B 4、提取出与表B不同的表A的记录 select * from B union select * from A limit cnt后面怎么做?你自己决定
不要那么麻烦了,把表发出来, create table .. insert into ..然后把你想要的结果做一份范本出来
select a,id,b.id from a,b where a.filed1=b.filed1 and a.filed2=b.filed2 and a.filed3=b.filed3 然后再删除吧
亲们,谢谢大家支持,在大家的帮助下已解决delete a,b FROM a LEFT JOIN b ON a.c_num=b.c_num and a.c_jifen=b.c_jifen where a.c_num=b .c_num
比如select a,id,b.id from a,b where a.filed1=b.filed1 and a.filed2=b.filed2 and a.filed3=b.filed3这样查询然后删除了
2、提取出与表A不同的表B的记录 select * from A union select * from B limit cnt
3、取得 表B 的记录数备用 select count(*) as cnt from B
4、提取出与表B不同的表A的记录 select * from B union select * from A limit cnt后面怎么做?你自己决定
create table ..
insert into ..然后把你想要的结果做一份范本出来
然后再删除吧
.c_num