我更改了查询,以便Date列大小写完全匹配查询结果中的内容.
select Date, count(Date) from TABLE where Date >= '2008-10-12' and Date <= '2008-10-13' group by Date
您需要在from子句中更改TABLE,但其他所有内容对于您的表都应该是正确的.
编辑:
我有一个类似结构的表,我更改了一个名为'Date'的日期列.以下对我有用.
mysql> select Date, count(Date) from calendar_items where date between '2008-12-12' and '2008-12-13' group by Date; +------------+-------------+ | Date | count(Date) | +------------+-------------+ | 2008-12-12 | 14 | | 2008-12-13 | 6 | +------------+-------------+ 2 rows in set (0.00 sec) mysql>