Re: sql question...
From: Igor Keselman <Igor.Keselman_at_ab.com>
Date: 1997/06/12
Message-ID: <33A05255.37BD_at_ab.com>#1/1
> What surprised me is that #1 did not return anyone with a null value?
> I thought it would? Why didn't it?
Date: 1997/06/12
Message-ID: <33A05255.37BD_at_ab.com>#1/1
oispeggy_at_acsu.buffalo.edu wrote:
>
> Learn something new every day....
>
> 1.
> select lname, fname This returns everyone with 'N' or 'G' or ' '.
> from resdemo None with 'Y'. None with null.
> where fellow != 'Y'
>
>>
> What surprised me is that #1 did not return anyone with a null value?
> I thought it would? Why didn't it?
Because it's supposed to select rows that "make" (fellow!='Y') TRUE. But, (null!='Y') is not TRUE (it's not FALSE either go figure :-) )
In your case you could probably do something like:
select lname, fname
from resdemo
where nvl(fellow,'N')!='Y'
Hope it helps,
Igor Received on Thu Jun 12 1997 - 00:00:00 CEST