答案 0 :(得分:2)
您需要在sync_date
中使用DATE(ins。group by clause
)而不是ins。sync_date
SELECT COUNT(ins.`id`) AS Total, DATE(ins.`sync_date`) AS 'Date Time'
FROM `installations` ins
GROUP BY DATE(ins.`sync_date`)
ORDER BY DATE(ins.`sync_date`) DESC
答案 1 :(得分:1)
您需要group by DATE(ins.
同步日期)
,因为其中包含ins.sync_date
小时分秒。
SELECT COUNT(ins.`id`) AS Total, DATE(ins.`sync_date`) AS 'Date Time'
FROM `installations` ins
GROUP BY DATE(ins.`sync_date`)
ORDER BY ins.`sync_date` DESC