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: The use of COUNT(*)

Re: The use of COUNT(*)

From: Jurij Modic <jmodic_at_src.si>
Date: Mon, 13 Jul 1998 12:46:58 GMT
Message-ID: <35a9ffd8.23275268@news.siol.net>


On Fri, 10 Jul 1998 18:04:00 GMT, doid <doid_at_usa.net> wrote:

>Been there:)
>
>1) count(*) won't count nulls. this can screw up your logic
>sometimes...anyway, it's much more efficent to count( <some indexed column> )
>or count(1)

If there is no specific condition in the WHERE clause then:  

  1. count(*) ........... *WILL* count nulls.
  2. count(1) ........... *WILL* count nulls.
  3. count(col_name) .... *WON'T* count rows having NULL in col_name, regardless of the index existance.
    >
    >Hope this helped,
    >
    >doid

Regards,
--
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Mon Jul 13 1998 - 07:46:58 CDT

Original text of this message

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