Subject Re: [ib-support] Re: COUNT discrepancy in DSQL & VIEW
Author Nando Dessena
Lele,

> c> What would be the quickest SQL to compare two tables to find
> c> records that only appear in one or the other?
>
> SELECT 'AONLY', *
> FROM table_a
> WHERE NOT EXISTS (SELECT *
> FROM table_b
> WHERE table_a.KEY = table_b.KEY)
>
> UNION
>
> SELECT 'BONLY', *
> FROM table_b
> WHERE NOT EXISTS (SELECT *
> FROM table_a
> WHERE table_a.KEY = table_b.KEY)

shouldn't an outer join be quicker than a correlated subquery?
Ciao
--
____
_/\/ando