how can I count enum values -
09-27-2006
, 06:11 AM
I have a table like this:
id car state regdate
===========================
1 toyota good 2006-04-01
2 toyota good 2006-04-05
3 ford bad 2006-05-25
.....
the state column is ENUM ('good','bad','very bad')
given a car name (lets say toyota), I want a query that returns the
number of 'good', 'bad' and 'very bad' cars registered for each month
like this:
month good bad very bad
april 2006 2 0 0
may 2006 1 1 2
.....
How can I do that? |