Here's an example:
try drop table #tb1; catch all end try;
try drop table #tb2; catch all end try;
create table #tb1(id integer, test char(20));
create table #tb2(id integer, test char(20));
insert into #tb1(id, test) values(1,'a');
insert into #tb1(id, test) values(2,'a');
insert into #tb1(id, test) values(3,'a');
insert into #tb1(id, test) values(4,'a');
insert into #tb2(id, test) values(1,'a');
insert into #tb2(id, test) values(2,'b');
insert into #tb2(id, test) values(3,'b');
insert into #tb2(id, test) values(4,'a');
select a.id, a.test, b.id, b.test
from #tb1 a
full outer join #tb2 b on a.id=b.id and a.test=b.test
where a.id is null or b.id is null
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
15 | |
12 | |
11 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 |