you need the 'group by' clause. The following line will return a result
that has the status field and the count for each type.
select status, count(*) from <table> group by status
Matt
Eric Anderson wrote:
>I'm not sure if I'm just having problems thinking today but if you've
>got a field:
>
>status enum('pending','active','cancelled') NOT NULL default 'pending'
>
>and you want to get a total of each the entries, is there any way to do
>it in one pass, as opposed to:
>
>select count(*) from <table> where status='pending'
>select count(*) from <table> where status='active'
>...
>
>mysql,sql
>
>
>
>