MySQL: count enumerated values?
Posted
by John Isaacks
on Stack Overflow
See other posts from Stack Overflow
or by John Isaacks
Published on 2010-04-07T20:41:04Z
Indexed on
2010/04/07
20:53 UTC
Read the original article
Hit count: 222
If my table looks like this:
daily_individual_tracking', 'CREATE TABLE `daily_individual_tracking` (
`daily_individual_tracking_id` int(10) unsigned NOT NULL auto_increment,
`daily_individual_tracking_date` date NOT NULL default ''0000-00-00'',
`sales` enum(''no'',''yes'') NOT NULL COMMENT ''no'',
`repairs` enum(''no'',''yes'') NOT NULL COMMENT ''no'',
`shipping` enum(''no'',''yes'') NOT NULL COMMENT ''no'',
PRIMARY KEY (`daily_individual_tracking_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
basically the fields can be either yes or no.
How can I count how many yes's their are for each column over a date range?
Thanks!!
© Stack Overflow or respective owner