title: How to fill date gaps in MySQL?
body: <p>How i can fill date gaps in MySQL? Here is my query:</p>
  
  <pre>
  SELECT DATE(posted_at) AS date,
      COUNT(*) AS total,
      SUM(attitude = 'positive') AS positive,
      SUM(attitude = 'neutral') AS neutral,
      SUM(attitude = 'negative') AS negative
      FROM `messages`
      WHERE (`messages`.brand_id = 1)
      AND (`messages`.`spam` = 0
      AND `messages`.`duplicate` = 0
      AND `messages`.`ignore` = 0)
      GROUP BY date ORDER BY date
  </pre>
  
  <p>It returns proper result set - but i want to fill gaps between dates start and end by zeros. How i can do this?</p>