Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: join query question
It depends on a number of factors. A hash anti join may be the best.
You can use
not in
not exists
minus
outer join using nulls
hash anti-join
in order from worse to best most texts list
not in
minus
not exists
outer join using nulls
hash anti-join
In article <3b321a79.256948140_at_news.alt.net>,
SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK (Brian Tkatch) wrote:
>On Thu, 21 Jun 2001 15:37:19 GMT, vk02720 <nospam_at_newsranger.com>
>wrote:
>
>>table A and table B both have a common field empnum.
>>What is the most optimal query to get the data from table A which is not in
the
>>table B using empnum ?
>>
>>TIA
>
>I would assume
>
>SELECT * FROM Table_A WHERE NOT EXISTS
> (SELECT * FROM Table_B WHERE Empnum = Table_A.Empnum);
Received on Thu Jun 21 2001 - 16:34:09 CDT