title: get all the past 7 dates from the current date in mysql
body: <p>How to show all the dates from the past 7 days starting from the current day . For eg : if today is 10/3/2018 . I want the output to be </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>10/3/2018
  9/3/2018
  8/3/2018
  7/3/2018
  6/3/2018
  5/3/2018
  4/3/2018</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now the main thing is that my table does not have entry for all the dates .So if i use between or something like that . it will show me only the dates that are available in the table.</p>
  
  <p>I am actually trying to fetch the data for the past 7 days and if nothing is available for that day then zero or blank should come.</p>
  
  <p>EDIT 1:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Select curdate()
  union Select date_sub(Curdate(),interval 1 day) 
  union Select date_sub(Curdate(),interval 2 day) 
  union Select date_sub(Curdate(),interval 3 day) 
  union Select date_sub(Curdate(),interval 4 day)
  union Select date_sub(Curdate(),interval 5 day) 
  union Select date_sub(Curdate(),interval 6 day)
  from detail</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now this is returning all the previous dates like i wanted , but i am still not able to <code>group</code> it properly with the <code>where</code> clause . So that the dates return the number of orders placed on that day and return 0 if nothing is found .</p>
  
  <p><code>SELECT count(id) from detail where status in(3,7)</code>.</p>
  
  <p>This was the original query</p>