title: Count data as zero if it is null when where clause is used
body: <p>Now I have this query:</p>
  
  <pre><code>SELECT 
  opp.name as name,
  count(log.stage_id) as stage_count
  FROM 
  crm_lead as opp LEFT OUTER JOIN crm_lead_stage_log as log ON (opp.id = log.opportunity_id)
  GROUP BY
  name
  </code></pre>
  
  <p>And it outputs this result:</p>
  
  <pre><code>name  | stage_count |
  name1 | 2
  name2 | 1
  name3 | 0 
  </code></pre>
  
  <p>And it outputs what I need. But if I put any condition to it, then it skips rows with zero count, which I need to be able to see.
  For example if I write this query:</p>
  
  <pre><code>SELECT 
  opp.name as name,
  count(log.stage_id) as stage_count
  FROM 
  crm_lead as opp LEFT OUTER JOIN crm_lead_stage_log as log ON (opp.id = log.opportunity_id)
  WHERE WHEN log.create_date &gt; '2014-01-28 08:49:03'
  GROUP BY
  name
  </code></pre>
  
  <p>Then it outputs this:</p>
  
  <pre><code>name  | stage_count |
  name1 | 1
  </code></pre>
  
  <p>It counts existing stages number in that time interval correctly, but it skips rows which stages number is not existing in the time inerval. How can I make it output like this (in that example only one stage for first row is counted in that time interval with new query, for other rows, it counts zero, because it does not exist):</p>
  
  <pre><code>name  | stage_count |
  name1 | 1
  name2 | 0
  name3 | 0 
  </code></pre>
  
  <p>Is it possible to do it like that? 
  P.S. if more information is needed, like to put this query sample online to check it out, just write a comment and I will update my answer).</p>