I have the following table :
administratieID | varchar
getalTypeNaam | varchar
datum | date
waarde | double
With the following query:
Select administratieID AS AI, waarde WA, datum DT
from getalType
where getalTypeNaam = 'test'
and datum between DATE_SUB(NOW(), INTERVAL 10 DAY) and DATE_SUB(NOW(), INTERVAL 15 DAY)
order by datum
What I want is that I can do a select where all the dates between the specified dates are returned even if there is nothing in the database that coresponds with that date. I want this even if there is no value but in that case i want to return the value 0.
So I want this in return:
date administratieID waarde
10-10-2016 xxx 10
11-10-2016 xxx 0 <-- no data available
12-10-2016 xxx 40
13-10-2016 xxx 9
14-10-2016 xxx 0 <-- no data available
Now I get this:
date administratieID waarde
10-10-2016 xxx 10
12-10-2016 xxx 40
13-10-2016 xxx 9