Re: Tune query with "NOT IN"
From: J.P. <jp_boileau_at_yahoo.com>
Date: 15 Apr 2002 06:33:38 -0700
Message-ID: <7e388bc3.0204150533.7b8bf5fb_at_posting.google.com>
Date: 15 Apr 2002 06:33:38 -0700
Message-ID: <7e388bc3.0204150533.7b8bf5fb_at_posting.google.com>
The other answers given, however functional they may be, may work too slowly.
This will work better:
select ...
from table1, table2
where
table2.f3(+) = table1.f1 and table2.f4(+) = table1.f2 and table2.f3 IS NULL and table2.f4 IS NULL
This is know as an anti-join.
JP
brotherhou_at_yahoo.com (konghou) wrote in message news:<c19678a1.0204120116.66434be8_at_posting.google.com>...
> How to tune the query:
> select .... where (f1, f2) not in (select f3, f4 from ... )
> A "not exist" seems working as slow.
Received on Mon Apr 15 2002 - 15:33:38 CEST