title: sql left join with where confusion
body: <p>This is my current sql query</p>
  
  <pre><code>SELECT 
    urls.short, 
    urls.long, 
    urls.user, 
    dates.date AS date, 
    COUNT(views.short) AS views, 
    SUM(views.money) AS money 
  FROM dates 
  LEFT JOIN views ON dates.date = views.date
  LEFT JOIN urls ON views.short = urls.short
  WHERE urls.user='test'
  GROUP BY dates.date, views.date
  LIMIT 0, 20
  </code></pre>
  
  <p>It show results something like this :</p>
  
  <blockquote>
    <p>2011-02-08    test    test        1   0.003 <br/></p>
    
    <p>2011-02-09    test    test        6   0.016 <br/></p>
  </blockquote>
  
  <p>But when i remove </p>
  
  <pre><code>WHERE urls.user='test'
  </code></pre>
  
  <p>I get</p>
  
  <blockquote>
    <p>2011-02-05                0    <br/></p>
    
    <p>2011-02-06                0   <br/></p>
    
    <p>2011-02-07    44kc    <a href="http://google.com" rel="nofollow">http://google.com</a>       27  0.031
    <br/></p>
    
    <p>2011-02-08    44kc    <a href="http://google.com" rel="nofollow">http://google.com</a>       15  0.045
    <br/></p>
    
    <p>2011-02-09    test    test        12  0.032 <br/></p>
    
    <p>2011-02-10                0    <br/></p>
  </blockquote>
  
  <p>so finally i want to get the second query result using first query(to show 0 ,when there are nothing available).
  So whats the solution?</p>