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

Home -> Community -> Usenet -> c.d.o.tools -> Re: IN and NULL

Re: IN and NULL

From: TurkBear <johng_at_mm.com>
Date: 2000/02/10
Message-ID: <38a43a02.12192181@204.181.81.99>#1/1

I'm not sure that there is a better way - NULL is special and only 'responds' to the IS and IS NOT operators

Ian Buzer <ianbNOiaSPAM_at_coolbop.demon.co.uk.invalid> wrote:

>Hi,
>
>Having a bit of a wrestle trying to get this statement to work in
>Oracle 8:
>
>SELECT *
>FROM products
>WHERE product IN ('Nuts and Bolts', NULL)
>AND category IN ('Hardware', NULL)
>
>It just appears to ignore the NULL condition. Replacing NULL with
>'' doesn't help either.
>
>The following works fine, but is somewhat more ugly, and I
>would imagine somewhat slower:
>
>SELECT *
>FROM products
>WHERE (product = 'Nuts and Bolts' OR product IS NULL)
>AND (category = 'Hardware' OR category IS NULL)
>
>Any ideas, advice?
>
>Many thanks
>Ian
>
>
>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
>The fastest and easiest way to search and participate in Usenet - Free!

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------    http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Thu Feb 10 2000 - 00:00:00 CST

Original text of this message

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