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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Difference between count(1) and count(*)

RE: Difference between count(1) and count(*)

From: Srinivasan Vasan <Vasan.Srinivasan_at_churchill.com>
Date: Thu, 8 Jul 2004 14:35:18 +0100
Message-ID: <4661DD1EF5C4EF4B9D2BCE3A3E52EF3304C321B5@brcexm04.churchill.com>


Actually, I don't consider myself an expert - that is something for others to judge. However, my apologies if the e-mail was interpreted as offensive.

E-mails do not have a tone or an attitude. Tanel meant to present a derogatory view of experts with the email to which I responded, but I read it as written and responded with curiosity, not superiority.

Cheers,

Vasan.
-----Original Message-----
From: rob zijlstra [mailto:rmsah_at_xs4all.nl] Sent: 08 July 2004 13:21
To: oracle-l_at_freelists.org
Subject: RE: Difference between count(1) and count(*)

Vasan,

Well, your question indicates that you don't have the right attitude to be an expert. The real question should be: 'How long will it take to ascertain that in your system count(null) has no meaning and so how long can I write bills?'

Rob Zijlstra

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Srinivasan Vasan
Sent: donderdag 8 juli 2004 14:13
To: 'oracle-l_at_freelists.org'
Subject: RE: Difference between count(1) and count(*)

Hi! Tanel,

        What exactly would we use a COUNT(NULL) for as it always returns 0?

Cheers,=20

Vasan.

-----Original Message-----
From: Tanel P=F5der [mailto:tanel.poder.003_at_mail.ee]=20 Sent: 08 July 2004 09:38
To: oracle-l_at_freelists.org
Subject: Re: Difference between count(1) and count(*)

I've actually seen an "expert" optimizing the count() statement, by = using
count(null) "since null means nothing and thus is the fastest" :)

But check this:

SQL> select count(*) from dual;

  COUNT(*)


         1

SQL> select count(null) from dual;

COUNT(NULL)


          0

Tanel.

> > On Thu, 8 Jul 2004 11:27:28 +0530 oracle-l_at_freelists.org wrote:
> > > Can you let me know the difference between count(*) and count(1) =
?
> >
> > count(1) is supposed to be more efficient and faster.

>
> Oh boy, here we go.
>
> --
> Jeremiah Wilton
> http://www.speakeasy.net/~jwilton
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to:  oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

________________________________________________________________________=
___=20


This email and any attached to it are confidential and intended only =
for the
individual or entity to which it is addressed.  If you are not the =
intended
recipient, please let us know by telephoning or emailing the sender.  =
You
should also delete the email and any attachment from your systems and =
should
not copy the email or any attachment or disclose their content to any =
other
person or entity.  The views expressed here are not necessarily those =
of
Churchill Insurance Group plc or its affiliates or subsidiaries. Thank =
you.=20

Churchill Insurance Group plc.  Company Registration Number - 2280426.
England.=20

Registered Office: Churchill Court, Westmoreland Road, Bromley, Kent =
BR1
1DP.=20


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

___________________________________________________________________________ 


This email and any attached to it are confidential and intended only for the
individual or entity to which it is addressed.  If you are not the intended
recipient, please let us know by telephoning or emailing the sender.  You
should also delete the email and any attachment from your systems and should
not copy the email or any attachment or disclose their content to any other
person or entity.  The views expressed here are not necessarily those of
Churchill Insurance Group plc or its affiliates or subsidiaries. Thank you. 

Churchill Insurance Group plc.  Company Registration Number - 2280426.
England. 

Registered Office: Churchill Court, Westmoreland Road, Bromley, Kent BR1
1DP. 


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Thu Jul 08 2004 - 08:31:59 CDT

Original text of this message

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