我正在从 Mysql 数据库中检索数据,查询是这样的:
SELECT
DATE(cap_newspaper_page.insertDate) AS _Date,
count(*) AS Image_Captured
FROM
cap_newspaper_page
WHERE
cap_newspaper_page.insertDate BETWEEN '2012-11-01' AND '2012-11-13'
GROUP BY
DATE(cap_newspaper_page.insertDate)
ORDER BY
DATE(cap_newspaper_page.insertDate)
数据显示为
但我也想显示未插入数据库的 Null 值。像 2012-11-03、2012-11-04、2012-11-09、2012-11-11 没有插入数据库中,但我想将它们显示为 Null 或 0。喜欢
- 2012-11-01 581
- 2012-11-02 587
- 2012-11-03 0/无
- 2012-11-04 0/无
- 2012-11-05 752
- 2012-11-06 690
- 2012-11-07 495
- 2012-11-08 623
- 2012-11-09 0/无
- 2012-11-10 921
- 2012-11-11 0/无
- 2012-11-12 755
有任何想法吗??