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: Randy A. Stebbins <randys_at_triax.com>
Date: 1997/06/13
Message-ID: <01bc77b0$21367de0$146930cf@default>#1/1

Eric L'HUILLIER <elhuilli_at_ifremer.fr> wrote in article <01bc74d5$8a60ff80$2da1f686_at_ifremer.ifremer.fr>...
> 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.
>

Note that your last column can be null. I suspect it is always null. Null is not equal to anything, even itself. So pcg_numlig = pcg_numlig would never be true. Received on Fri Jun 13 1997 - 00:00:00 CDT

Original text of this message

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