title: MySQL - fill missing dates
body: <p>I have this query and I want to fill missing dates with some values (zero for example...)</p>
  
  <pre><code>SELECT date, SUM(val1) as sum_val  
  FROM table1  
  WHERE date BETWEEN '2016-03-04' AND '2016-03-10'  
  GROUP BY date
  </code></pre>
  
  <p>Here is result:</p>
  
  <pre><code>|--------------------------  
  |date, sum_val  
  |--------------------------  
  |2016-03-04, 21568  
  |--------------------------  
  |2016-03-05, 14789  
  |--------------------------  
  |2016-03-08, 20568  
  |--------------------------  
  |2016-03-10, 5841  
  |--------------------------
  </code></pre>
  
  <p>How can I populate missing dates with zero values? Does anyone has an idea?  </p>
  
  <p>I need this data for <strong>chart</strong> preview.</p>