在阅读了几个类似的 Qs/As 之后,我还没有完全找到我正在寻找的解决方案。我拥有的表数据是 GROUP BY DATE(timestamp) 并返回一个计数,示例结果:
[timestamp] => 2010-05-12 20:18:36
[count] => 10
[timestamp] => 2010-05-14 10:10:10
[count] => 8
在不使用临时表或日历表的情况下,有没有办法填补那些缺失的日期?这样使用相同的表数据将返回:
[timestamp] => 2010-05-12 20:18:36
[count] => 10
/**
* I would like to have this row added:
*/
[timestamp] => 2010-05-13 00:00:00
[count] => 0
[timestamp] => 2010-05-14 10:10:10
[count] => 8
谢谢!