title: Query orders table and get most recent record for each customer
body: <p>I have a table of orders. Customers can appear multiple times. The orderID column is an auto increment. I need to run a query to get the most recent order for each customer BUT I need to get the orderID, orderDate and orderProduct of their latest order.</p>
  
  <pre><code>customer    orderID     orderDate       orderProduct
  1           1           2015-01-01      shoes
  1           2           2015-02-01      food
  1           3           2015-03-01      drinks
  2           4           2015-01-01      water
  2           5           2015-04-01      beer
  3           6           2015-01-01      pizza
  3           7           2015-07-01      pasta
  </code></pre>
  
  <p>I had hoped to use:</p>
  
  <pre><code>select orders.*, max(orderDate) as latestOrder from orders group by customer
  </code></pre>
  
  <p>But this doesn't seem to give me what I need.</p>
  
  <p>The results I am looking for would be:</p>
  
  <pre><code>customer    orderID     orderDate       orderProduct
  1           3           2015-03-01      drinks
  2           5           2015-04-01      beer
  3           7           2015-07-01      pasta
  </code></pre>