Re: Count the number of specific rows
- Date: Fri, 29 Dec 2006 16:44:29 +0000
- From: Philip Mather <philm@xxxxxxxxx>
- Subject: Re: Count the number of specific rows
Servers24,
Hi Philip,
Thank you very much for your help.
Can you please tell me the differemce between COUNT(*) and COUNT(id) ?
Thanks again.
Actually sorry I was a bit misleading there. MySQL is optimized to
calculate...
SELECT COUNT(*) FROM aTable;
...but given the fact you've got a where condition that optimizations
probably no longer applicable, so I'd stick with...
SELECT COUNT(id) FROM sent WHERE member_id = ...;
...the real difference would be when you do a SELECT COUNT(DISTINCT id)
instead of a SELECT COUNT(DISTINCT *) which are different questions but
not relevant to your situation.
Regards,
Phil
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=royale@xxxxxxxxxx