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 -> IN and NULL

IN and NULL

From: Ian Buzer <ianbNOiaSPAM_at_coolbop.demon.co.uk.invalid>
Date: 2000/02/10
Message-ID: <01c4f9cd.1ec32b84@usw-ex0103-024.remarq.com>#1/1

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

Received on Thu Feb 10 2000 - 00:00:00 CST

Original text of this message

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