 Joined: Jul 2008 Posts: 41
 
 United States
|
Jul 23, 2008, 01:20:37 PM | #1 |
I need to write a sql statement for mysql that counts the number of records that contain a specific value and null using one query instead of lots of separate queries.
I tried this query but it's not working
SELECT site_stat, COUNT(site_stat='Approved') AS "approved", COUNT(site_stat='NULL') AS "not approved" FROM sites GROUP BY site_stat
How can I do this? Is it even possible ?
|
|