Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: comparing nulls
>>>>> "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.comReceived on Tue Jul 25 2000 - 00:00:00 CDT
![]() |
![]() |