Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NOT IN is very inefficient
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