title: Dynamically creating date periods using MySQL
body: <p>I trying to get the Grape count from dates March 1 - 3.</p>
  
  <p><img src="https://i.stack.imgur.com/fScSk.jpg" alt="enter image description here"></p>
  
  <p>You will notice that on March 2 - there are no grapes inserted..</p>
  
  <p>I'st possible to show a query from dates March 1, 2 and 3 but showing 0 count for March 2
  <img src="https://i.stack.imgur.com/0HYTw.jpg" alt="enter image description here"></p>
  
  <p>In this image above only shows dates where there are grapes..</p>
  
  <p>Here is mySQL query</p>
  
  <pre><code>SELECT  `fruitDate` ,  `fruitName` , COUNT( * ) 
  FROM  `tbl_fruits` 
  WHERE  `fruitName` =  "Grapes"
  GROUP BY  `fruitDate
  </code></pre>
  
  <p>UPDATE 2:</p>
  
  <p>Using this query:</p>
  
  <pre><code>SELECT f.fruitDate, f.fruitName, f1.count FROM tbl_fruits f
      LEFT JOIN (SELECT fruitDate, COUNT(*) as count from tbl_fruits d WHERE d.fruitName='Grapes' GROUP BY d.fruitDate) as f1 ON (f.fruitDate = f1.fruitDate) 
      GROUP BY f.fruitDate
  </code></pre>
  
  <p>I got this result..but its dsplaying diffrent fruit..something wrong with my query?</p>
  
  <p><img src="https://i.stack.imgur.com/N9QHx.jpg" alt="enter image description here"></p>