Possible Duplicate:
MySQL how to fill missing dates in range?
I have table with name "trip_data".There it is having four fields
|trip_paramid|fuel_content|creation_time|vehicle_id
I want to generate a report so that input parameters will be FromDate and ToDate.So output should contain all the date in between From and to date(creation_time) also corresponding Maximum fuel_content for each date.If corresponding fuel_content is not there for a date,then fuel_content should be displayed as "NIL".How can i write a query for this in MySQL.So i need a query to display all dates in between two date range even if there is no corresponding data for that."Following is the sample schema and data for this table. http://sqlfiddle.com/#!2/d6d207