MySQL how to fill missing dates in range?
问题 I have a table with 2 columns, date and score. It has at most 30 entries, for each of the last 30 days one. date score ----------------- 1.8.2010 19 2.8.2010 21 4.8.2010 14 7.8.2010 10 10.8.2010 14 My problem is that some dates are missing - I want to see: date score ----------------- 1.8.2010 19 2.8.2010 21 3.8.2010 0 4.8.2010 14 5.8.2010 0 6.8.2010 0 7.8.2010 10 ... What I need from the single query is to get: 19,21,9,14,0,0,10,0,0,14... That means that the missing dates are filled with 0.