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

Home -> Community -> Usenet -> c.d.o.server -> Re: comparing nulls

Re: comparing nulls

From: Galen Boyer <galenboyer_at_yahoo.com>
Date: 2000/07/25
Message-ID: <uhf9dzhg9.fsf@yahoo.com>#1/1

>>>>> "orauser" == orauser <orauser_at_my-deja.com> writes:

,----
| select count(*) from t1, t2
| where
| t1.a1 = t2.a2
| t1.b1 = t2.b2
| t1.c1 = t2.c2;

`----

 orauser> and all is well until say t1.b1 and t2.b2 are both  orauser> null. Then the equality is not true.

 orauser> Can someone tell me the correct way to write this
 orauser> without having to do something special for the nullable
 orauser> columns??

TRY:
select count(*) from t1,t1
where
(t1.a1 = t2.a2 or t1.a1 is null or t2.a2 is null) and (t1.b1 = t2.b2 or t1.b1 is null or t2.b2 is null) and ...

-- 
Galen Boyer
Database Architect
Primix Solutions, www.primix.com
Received on Tue Jul 25 2000 - 00:00:00 CDT

Original text of this message

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