count(*)? was: Re: Query Question...

2005-07-16 Thread Nic Stevens
Hi , This is a little off topic but I have seen count(*) on this list afew times and it got me wondering... Is there a reason to use SELECT COUNT(*) as opposed to SELECT COUNT(column)? I have noticed that selecting count(*) versus specifying the column name executes much more slowly. I've

Re: count(*)? was: Re: Query Question...

2005-07-16 Thread stipe42
I believe the difference is that count(*) includes nulls (because it is counting the number of records), whereas count(column) only counts the records where the column being counted is not null, regardless of the total number of rows. Hmm, on a related question then if I am correct above, does

Re: count(*)? was: Re: Query Question...

2005-07-16 Thread Michael Stassen
stipe42 wrote: I believe the difference is that count(*) includes nulls (because it is counting the number of records), whereas count(column) only counts the records where the column being counted is not null, regardless of the total number of rows. Right. COUNT(*) counts rows, COUNT(col)