title: Generating a series of dates
body: <p>What is the best way in mysql to generate a series of dates in a given range?</p>
  
  <p>The application I have in mind is to write a report query that returns a row for every date, regardless of whether there is any data to report. In its simplest form:</p>
  
  <pre><code>select dates.date, sum(sales.amount)
  from &lt;series of dates between X and Y&gt; dates
  left join sales on date(sales.created) = dates.date
  group by 1
  </code></pre>
  
  <p>I have tried creating a table with lots of dates, but that seems like a poor workaround.</p>