create table #t1(
id int,
col1 int,
col2 int
)
insert into #t1 values(1,27,3)
insert into #t1 values(2,22,3)
insert into #t1 values(3,22,3)
insert into #t1 values(4,23,3)
insert into #t1 values(5,3,3)
create table #t2(
id int,
col1 int,
col2 int
)
insert into #t2 values(1,27,3)
insert into #t2 values(2,22,3)
insert into #t2 values(3,22,3)
insert into #t2 values(4,23,3)
insert into #t2 values(5,3,3)
--这两行是多出来的.
insert into #t2 values(7,23,3)
insert into #t2 values(8,3,3)
select b.* from #t1 a full join #t2 b on a.id=b.id where a.id is null
drop table #t1,#t2
/*
id col1 col2
----------- ----------- -----------
7 23 3
8 3 3
*/