title: Get all users even if no records in another table
body: <p>I'm facing a problem here :</p>
  
  <p>I have two tables :</p>
  
  <p>A <code>users</code> table :</p>
  
  <pre><code>+----+---------------+----------+
  | id | username      | company  |
  +----±---------------±----------+
  | 1  | John          | 0        |
  | 2  | Jack          | 0        |
  | 3  | Casimir       | 0        |
  ±----±---------------±----------±
  </code></pre>
  
  <p>A <code>orders</code> table :</p>
  
  <pre><code>+----+---------------+----------+--------+
  | id | date          | iduser   | status |
  +----±---------------±----------+--------+
  | 1  | 2012-05-28    | 1        | 1      |
  | 2  | 2012-05-25    | 1        | 1      |
  | 3  | 2012-04-28    | 2        | 1      |
  | 4  | 2012-03-28    | 1        | 1      |
  | 5  | 2012-02-28    | 2        | 0      |
  ±----±---------------±----------±--------+
  </code></pre>
  
  <p>What I'm trying to do is to get a result like this :</p>
  
  <pre><code>+----------+---------------+-------------+
  | username | COUNT(order)  | MAX(date)   |
  +----------±---------------±-------------+
  | John     | 3             | 2012-05-28  |
  | Jack     | 1             | 2012-04-28  |
  | Casimir  | 0             | NULL        |
  ±----------±---------------±-------------±
  </code></pre>
  
  <p>Here's the request I have for the moment :</p>
  
  <pre><code>SELECT u.username, COUNT(o.id), MAX(o.date)
  FROM users u
  INNER JOIN orders ON u.id = o.iduser
  WHERE o.status = 1
  GROUP BY u.id
  </code></pre>
  
  <p>This request gives me a result like :</p>
  
  <pre><code>+----------+---------------+-------------+
  | username | COUNT(order)  | MAX(date)   |
  +----------±---------------±-------------+
  | John     | 3             | 2012-05-28  |
  | Jack     | 1             | 2012-04-28  |
  ±----------±---------------±-------------±
  </code></pre>
  
  <p>As you can see, the user <code>Casimir</code> is not shown as he made no order. How can I modify my request to get the result I need please ?</p>
  
  <p>Thanks !</p>