两张表找重复数据并删除

删除与查找语句
DELETE a FROM vidb.dbo.gsk_new a
LEFT JOIN gsk_deregistration b on a.公司名=b.公司名
WHERE b.[公司名] is not null

select a.公司名 from (select 公司名 from vidb.dbo.gsk_new) a
left join gsk_deregistration b
on a.公司名=b.公司名
where b.[公司名] is not null

猜你喜欢

转载自www.cnblogs.com/cheng-cheng/p/10687615.html