Subject | Re: [ib-support] Re: COUNT discrepancy in DSQL & VIEW |
---|---|
Author | Nando Dessena |
Post date | 2002-05-17T10:19Z |
Lele,
Ciao
--
____
_/\/ando
> c> What would be the quickest SQL to compare two tables to findshouldn't an outer join be quicker than a correlated subquery?
> 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)
Ciao
--
____
_/\/ando