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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: is null / = null query

RE: is null / = null query

From: Javier Morales <Javier_at_infojobs.net>
Date: Fri, 10 Nov 2000 13:09:06 +0100
Message-Id: <10676.121699@fatcity.com>


Null =3D I_DONT_KNOW_THE_VALUE

SELECT COUNT(*) FROM WERK_ORDER WHERE RESULT_CODE_WO =3D NULL; 0
1 row selected.

Oracle is saying something like that...
"you asked me for counting the fields where the RESULT_CODE_WO field =
has an
unknown value... but I know the values of EVERY RECORD... including = the
null values... (wich value is "I_DON'T_KNOW_THE_VALUE" ...)

SQL> SELECT COUNT(*) FROM WERK_ORDER WHERE RESULT_CODE_WO IS NULL;        301

1 row selected.

Oracle is saying something like that...
"you asked me for counting the fields where the RESULT_CODE_WO field =
has a
"I_DONT_KNOW_THE_VALUE" value... so I found 301 NULL values in that =
field"

... I hope you understand now!!... eheh... It's a bit complex at the begining of all, but It's just to get the trick !! ;-))

Regards,
Javier=20



 Javier Morales - javier_at_infojobs.net
 Administraci=F3n Bases de Datos Oracle - InfoJobs.net  Tel. +34 902 10 60 90 Ext. 2067
 Fax. +34 (93) 580 56 60
=20

-----Mensaje original-----
De: Rao, Maheswara [mailto:Maheswara.Rao_at_Sungardp3.com] Enviado el: jueves 9 de noviembre de 2000 17:06 Para: Multiple recipients of list ORACLE-L Asunto: RE: is null / =3D null query

Gkor,

When you want to compare null you use the clause IS NULL . Alternately, = IS
NOT NULL. As per your query, the second query is returning the result correctly. = The
first query returned zero rows because =3DNULL did not work.

Now, please clarify, what exactly you mean by saying that you did not = expect
to get answer from the first query?

Rao

Maheswara.Rao_at_SunGardP3.com

-----Original Message-----

I have launched the following query in SQL*PLUS

SQL> L
  1* SELECT COUNT(*) FROM WERK_ORDER WHERE RESULT_CODE_WO =3D NULL; SQL> /
         0

1 row selected.

SQL> SELECT COUNT(*) FROM WERK_ORDER WHERE RESULT_CODE_WO IS NULL;        301

1 row selected.

SQL> i did'nt expect to get answer on the first query anyone with an = explanation
or is this a undocumented feature ?

thanks

gkor_at_rdw.nl
rdw the netherlands

--

--=20
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--=20
Author: Rao, Maheswara
  INET: Maheswara.Rao_at_Sungardp3.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Fri Nov 10 2000 - 06:09:06 CST

Original text of this message

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