简单问题:为什么以下查询不输出perday
?
SELECT FROM_UNIXTIME(`date`,"%Y-%m-%d") AS `perday`, COUNT(*) AS `count`
FROM `data`
WHERE `group` = 1
GROUP BY `perday`
计数正确输出,但perday
保持为空。表data
是这样的:
| id | group | date |
------------------------------------------------
| 1 | 1 | 2013-04-13 06:01:02 |
| 2 | 1 | 2013-04-13 14:24:18 |
| 3 | 2 | 2012-01-21 21:33:03 |
Ect.
谢谢!
编辑:
预期输出:
| perday |
--------------
| 2013-04-13 |
| 2012-01-21 |