select date_format(qar.create_date, '%y-%m-%d') as qarcreatedate, (case when qar.create_date > 0 then qar.id when qar.create_date = "null" then 0 end ) as qarid from xx_qrcode q left join xx_qrcode_access_record qar on qar.qrcode_id = q.id right join xx_product p on q.product_id = p.id where p.stores is null and qar.create_date between '2015-05-29' and '2015-06-05' group by qar.create_date
结果:
qarCreateDate qarid
2015-05-29 0
2015-05-30 0
2015-05-31 0
2015-06-01 0
2015-06-02267
2015-06-03268
2015-06-03269
2015-06-04270
2015-06-04271
,05-29—06-01是没查出来
请问怎么将2015-05-29,2015-05-30,2015-05-31和2015-06-01 这些不存在的也统计出来。非常感谢各位的指点!