Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> IN and NULL
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
![]() |
![]() |