title: Show all dates even those with zero data in it in mySQL?
body: <p>My following query shows the date and the count of the emails found on each day (last 2 days)</p>
  
  <p>My problem is that if no emails are found today, the today date will not be displayed on the output. (if yesterday has emails, it will show only 1 row with yesterday date and email).</p>
  
  <p>How can I edit my query to always show 2 rows, today and yesterday, date and number of emails even zero?</p>
  
  <pre><code>SELECT maildate, 
         COUNT(*) AS totalEmails 
  FROM   emails 
  WHERE  maildate &gt;= Date_add(Curdate(), interval - 2 DAY) 
         AND company_id = 1 
  GROUP  BY DATE(maildate) 
  ORDER  BY maildate desc 
  </code></pre>