Re: ANSI Semantics with NULL and NOT IN

From: William Thompson, code 682.1, x2040 <thompson_at_stars.gsfc.nasa.gov>
Date: Wed, 16 Sep 1992 17:45:00 GMT
Message-ID: <16SEP199213450843_at_stars.gsfc.nasa.gov>


In article <1992Sep16.135608.13489_at_almserv.uucp>, gaujxl_at_mercury.fnma.com (Jacob Lifshitz) writes...
>In article <1992Sep16.024053.1744_at_binky.Binky.COM> irwin_at_binky.Binky.COM (Irwin Schafer) writes:
>>Given table "r1":
>>
>> a1 a2 a3
>> 1 A null
>> 2 B 1
>> 3 C 1
>>
>>On Ingres, this query returns the value "A"
>> select a2 from r1 where a1 in
>> (select distinct a3 from r1);
>>
>>However, this query returns no rows
>> select a2 from r1 where a1 not in
>> (select distinct a3 from r1);
>>
>>Where one may expect two rows ("B" and "C")
>
>I tried it on Sybase and it does return "B" and "C"
>
>>Irwin irwin_at_Binky.COM
>Kobi
>

I've heard that the behavior of nulls is one of the things that can differ from on implementation of SQL to another, but I don't know who's doing it "right" and who's doing it "wrong".

Bill Thompson Received on Wed Sep 16 1992 - 19:45:00 CEST

Original text of this message