Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: NOT IN is very inefficient

Re: NOT IN is very inefficient

From: Geert Van Damme <Geert.vandamme_at_darling.be>
Date: 1998/10/12
Message-ID: <6vsc6e$dgr$2@sol6.tvd.be>#1/1

IMHO, it is correct.

If you filter 'B.i is null' it's the same thing as using your first query with an empty table B.

if table A = {1,2,3 and B = {}

 select A.i, B.i from A, B where A.i *= B.i

gives the correct answer

   A.i B.i

    1  (null)
    2  (null)
    3  (null)


Geert 'Darling' Van Damme

James Cribb wrote in message <6vma5n$qnb$1_at_the-fly.zip.com.au>...
>| Table A (i int) has values 1, 2, 3.
>| Table B (i int) has values 1, 3
>|
>| select A.i, B.i from A, B where A.i *= B.i
>|
>| ("*=" means "left outer join") returns
>|

 ...
>| Filtering "B.i is null" returns all three rows of A.
>
>does produce the unexpected result
>
> A.i B.i
> 1 (null)
> 2 (null)
> 3 (null)
>
>| Is this a bug in SQL Anywhere?
>
Received on Mon Oct 12 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US