日期:2014-05-18  浏览次数:20537 次

如何将表1中字段A值等于表2中字段A的记录删除?
表1的字段A和表2的字段A的结构是一直的,如何将表1中字段A值等于表2中字段A的记录删除?

------解决方案--------------------

delete 表1
where A in (select distinct A from 表2)
------解决方案--------------------
delete tmpA
from 表1 as tmpA, 表2 as tmpB
where tmpA.A=tmpB.A

------解决方案--------------------
delete from 表1 where exists(select * from 表2 wher a=表1.a)
------解决方案--------------------
DELETE TABLE1 FROM TABLE1 INNER JOIN TABLE2 ON TABLE1.ID=TABLE2.ID
------解决方案--------------------
delete from 表1,表2 where 表1.A = 表2.A