I want to know if 2 record sets are different. I use a full outer join
for that. Simple example:
select count(*) from
(
select 1 as c
union
select 2 as c
) t1
full outer join
(
select 1 as c
union
select 3 as c
) t2 on t1.c = t2.c
where t1.c is null or t2.c is null
SQLFiddle
If the record sets are equal then the count()
returns 0
.
Is there a better way to achieve that?