I think you want something like this:

SELECT genre, COUNT(*) as count FROM music GROUP BY genre;

Dan

> I am using PHP to maintain a catalog of music and have been just fine with
> it but have run into one thing i want to do and need some advice.
> 
> The format of the data is like so:
> 
> upc|genre|distributor|details
> 
> What I want to do is grab a "summary". So it would end up printing out:
> 
> rock (43)
> country (41)
> 
> and so on. Is this possible to do with one query or will I need to do it
> with more? So I want to count the number of each genre and provide a count
> for each.
> 
> Jeff



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to