select date(f1),count(*) from tt group by date(f1)
or select date_format(f1,'%Y-%m-%d'),count(*) from tt group by date_format(f1,'%Y-%m-%d')
select count(*) from table1 where date(col1)='2011-04-01' 或者 select count(*) from table1 where col1 between '2011-04-01' and '2011-04-01 23:59:59第二种效率高。
select date(f1),count(*) from tt where date(f1)='2011-04-01' group by date(f1)
select date_format(f1,'%Y-%m-%d'),count(*) from tt group by date_format(f1,'%Y-%m-%d')
或者
select count(*) from table1 where col1 between '2011-04-01' and '2011-04-01 23:59:59第二种效率高。