--測試
create table tb1 (列1 varchar(10), 列2 varchar (10),列3 varchar(10))
Insert into tb1
select 'A1','B1','C1'
union all select 'A2','B2','C2'
union all select 'A3','B3','C3'
union all select 'A4','B4','C4'
select * from tb1
create table tb2 (列1 varchar(10), 列2 varchar (10),列3 varchar(10))
Insert into tb2
select 'A1','B2','C1'
union all select 'A2','B2','C2'
union all select 'A5','C5','B1'
union all select 'A6','B6','C6'
select * from tb2
--刪除
drop table tb1
drop table tb2
select * from tb1 where 列1 in
(select 列1 from (select 列1 from tb1 union all select 列1 from tb2)a
group by 列1 having count(*)>1)