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

Home -> Community -> Usenet -> c.d.o.misc -> Re: "= null" & "is null"

Re: "= null" & "is null"

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 26 Aug 1999 14:00:57 GMT
Message-ID: <37cb4863.10703961@newshost.us.oracle.com>


A copy of this was sent to Norris <johnnie_at_cooper.com.hk> (if that email address didn't require changing) On 26 Aug 1999 12:25:26 GMT, you wrote:

>When using other than "is null" or "is not null", Oracle does not return
>error but it seems to me that it always returns false like "1 = 2".
>

it does not return FALSE always. It returns TRUE when the thing being compared to is itself a NULL value. See below where I say

select * from dual where null is null;

that gets 1 row showing the is null returns TRUE as well as FALSE.

>
>
>Thomas Kyte <tkyte_at_us.oracle.com> wrote:
>: A copy of this was sent to Norris <johnnie_at_cooper.com.hk>
>: (if that email address didn't require changing)
>: On 26 Aug 1999 11:40:22 GMT, you wrote:
>
>:>What is the difference between = null and is null?
>:>
>:>--
>
>
>: the major difference is that "is null" will alway evaluate to either TRUE or
>: FALSE whereas "= null" will NEVER evaluate to TRUE OR FALSE (it is unknown).
>
>: Consider:
>
>: tkyte_at_8.0> select * from dual where null is null;
>
>: D
>: -
>: X
>
>: tkyte_at_8.0> select * from dual where null = null;
>
>: no rows selected
>
>: tkyte_at_8.0> select * from dual where null != null;
>
>: no rows selected
>
>
>
>: It is almost always an error (cannot think of a case where it is not an error)
>: to say " = null"
>
>
>
>: --
>: See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
>: Current article is "Part I of V, Autonomous Transactions" updated June 21'st
>:
>: Thomas Kyte tkyte_at_us.oracle.com
>: Oracle Service Industries Reston, VA USA
>
>: Opinions are mine and do not necessarily reflect those of Oracle Corporation
>
>--

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Aug 26 1999 - 09:00:57 CDT

Original text of this message

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