title: MySQL Join Without Duplicates
body: <p>I have a customers table, and an orders table. Each customer can have many orders.</p>
  
  <p>I want to select every customer, along with their earliest order number from the orders table (it is important that I select the earliest order number, not just any order). I want to list customers whether they have an order or not, and I don't want to include customers twice if they have more than one order.</p>
  
  <p>I'm using this:</p>
  
  <pre><code>  SELECT *
      FROM customers
      LEFT JOIN orders
      ON customers.id = orders.customer_id 
      GROUP BY customers.id
  </code></pre>
  
  <p>This gives me <em>almost</em> what I want, except it will pick whatever order ID it likes from the table. I need to be able to sort, and pick the smallest order ID.</p>
  
  <p>Any ideas please?</p>
  
  <p>Im pretty sure its something that's staring me in the face...</p>
  
  <p><strong>EDIT:</strong> Tables' Structures as requested</p>
  
  <ul>
  <li><p>Customers:</p>
  
  <hr>
  
  <pre><code>| ID | Name | Address            | Etc |
  ----------------------------------------
  | 1  | Joe  | 123 Fake Street    |     |
  | 2  | Mike | 1600 Fake Road     |     |
  | 3  | Bill | Red Square, Moscow |     |
  ----------------------------------------
  </code></pre></li>
  <li><p>Orders:</p>
  
  <hr>
  
  <pre><code>| ID | Customer_ID | Date |
  ---------------------------
  | 1  | 1           |  ... |
  | 2  | 2           |  ... |
  | 3  | 2           |  ... |
  | 4  | 1           |  ... |
  ---------------------------
  </code></pre></li>
  </ul>