Hi,

SELECT SUM(IF(id = '2',1,0)) AS field_name FROM table

Versatile command - you can use it for quite a lot of things.

Barry Rumsey wrote:

> Is it posible to do a count(*) on a tabe where id=2  and count just those that id  = 
>2

--
----------
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to