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: Weird "select count(*)..."

Re: Weird "select count(*)..."

From: Lisa M. Lewis <lmg_at_isdsa.pgh.wec.com>
Date: 1997/06/11
Message-ID: <339E9C9A.8CC68CFC@isdsa.pgh.wec.com>#1/1

I think that there must be null values in the PCG_NUMLIG column. NULL=NULL is not true. You can't compare NULL values with '='.

Lisa

Eric L'HUILLIER wrote:

> Hi Netters,
>
> I tried the following queries :
>
> SQL> select count(*) from plan_comptable;
>
> COUNT(*)
> ---------
> 1784
>
> SQL> desc plan_comptable;
> Name Null? Type
> ------------------------------- -------- ----
> PCG_NUMCPTGEN NOT NULL VARCHAR2(10)
> PCG_LIBCPTGEN NOT NULL VARCHAR2(100)
> PCG_TYPSOLDE NOT NULL VARCHAR2(1)
> PCG_DURAMORT NOT NULL NUMBER(2)
> PCG_DETAIL NOT NULL VARCHAR2(1)
> PCG_NUMLIG NUMBER(5)
>
> SQL> select count(*) from plan_comptable
> 2 where pcg_numcptgen = pcg_numcptgen
> 3 and pcg_libcptgen = pcg_libcptgen
> 4 and pcg_typsolde = pcg_typsolde
> 5 and pcg_duramort = pcg_duramort
> 6 and pcg_detail = pcg_detail
> 7 and pcg_numlig = pcg_numlig;
>
> COUNT(*)
> ---------
> 0
>
> I think I should had the same result on both queries. Don't you think
> so ?
> If not why.
>
> NB : these rows were created with FORMS.
>
> TIA,
> --
> Eric L'HUILLIER
>
> ---------------
> -----------------------------------------------------------
> ! Rien n'est plus sur que l'informatique a part peut-etre
> l'astrologie. !
> ! Nothing is more reliable than computer science except
> astrology. !
> -------------------
> -------------------------------------------------------
> ! Ce message n'exprime qu'un point de vue purement
> personnel. !
> ! This message expresses my own opinion and doesn't involve my
> company. !
> ------------
> --------------------------------------------------------------
>
> eric.l.huillier_at_ifremer.fr
>
> IFREMER Brest (FRANCE)
>
> Tel : 02.98.22.47.40 (From France)
> Tel : +(33) 2.98.22.47.40 (From rest of the world)
Received on Wed Jun 11 1997 - 00:00:00 CDT

Original text of this message

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