title: Fill missing values with 0 - sql query
body: <p>I have an SQL query as outlined below that selects data between two dates. </p>
  
  <pre><code>SELECT date, total FROM db WHERE date &gt;= '2016-03-14' AND date &lt;= '2016-03-20';
  </code></pre>
  
  <p>I'd like to output a "0" where there's no data for various dates, for example:</p>
  
  <p>Query spans = <code>2016-03-14</code> to <code>2016-03-20</code></p>
  
  <p>Currently my SQL would output:</p>
  
  <pre><code>Date         Total
  2016-03-14   50
  </code></pre>
  
  <p>I'd like to output:</p>
  
  <pre><code>Date        Total
  2016-03-14  50
  2016-03-15  0
  2016-03-16  0
  2016-03-17  0
  2016-03-18  0
  2016-03-19  0
  2016-03-20  0
  </code></pre>
  
  <p>Is there any way to do this without complex joins?</p>
  
  <p>Thanks,</p>
  
  <p>Matt</p>