我在MySQL中进行选择并在两个日期之间进行搜索,并按日期对元素进行计数,并且工作正常但是,如果日期没有记录则不会出现,我正在寻找的是这样的:
列日期/计数
我得到了什么
2017-01-03因为没有记录而无法显示
查询:
SELECT I.FechaInstalacion, count(Case when I.ServicioId = 1 then 1 end) as P
FROM Instalacion I
WHERE I.EmpleadoId = 4 and I.FechaInstalacion>='2018-01-01' and
I.FechaInstalacion<= '2018-01-31'
group by I.FechaInstalacion
谢谢!