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: Char vs Varchar2 and NULL

Re: Char vs Varchar2 and NULL

From: <nasof_at_hotmail.com>
Date: Fri, 11 Sep 1998 12:39:32 GMT
Message-ID: <6tb5m4$bca$1@nnrp1.dejanews.com>


Here's an interesting one for you:

SELECT COUNT(*) FROM TABLE_A; Count(*)



120

SELECT COUNT(*) FROM TABLE_A
WHERE NULL = NULL; Count(*)



0

SELECT COUNT(*) FROM TABLE_A
WHERE NULL IS NULL; Count(*)



120

In article <6t902d$ef2_at_veenet.value.net>,   broom_at_veenet.value.net (C. Broom) wrote:
> In article <1998090902372200.WAA05083_at_ladder01.news.aol.com>,
> Jpmakar <jpmakar_at_aol.com> wrote:
> >Beware the Oracle NULL. It does not mean 'NULL', it means 'undefined'. I am
> >told but have not checked, that
> >
> >IF NULL = NULL THEN
> >
> >will always evaluate to false for the above reason.
>
> The word 'NULL' in a database means 'undefined' value. If my age is
> set to NULL and your age is also set to NULL then it makes sense that
> my age should not be considered to be equal to your age.
> In other words, neither my age nor yours is known so no statement can
> be made about their equality or lack thereof.
>
> In a database NULL = NULL is never true,
> just as NULL != NULL is never true.
>
> In C we can code '' to be a null string, but that is not at all
> the same as a database NULL.
>
> Cecil
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Fri Sep 11 1998 - 07:39:32 CDT

Original text of this message

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