title: MYSQL: Select MAX date from multiple columns
body: <p>I'm having trouble with a SQL query.
  This is my purchase table:</p>
  
  <pre><code>id       email                status       date
  1        user1@server.com     confirmed    2014-10-01
  2        user1@server.com     confirmed    2014-10-02
  3        user2@server.com     pending      2014-10-02
  4        user3@server.com     pending      2014-10-02
  5        user1@server.com     pending      2014-10-03
  6        user3@server.com     pending      2014-10-03
  7        user1@server.com     pending      2014-10-04
  8        user2@server.com     pending      2014-10-04
  9        user2@server.com     pending      2014-10-05
  </code></pre>
  
  <p>I want to select the most recent pending purchase for each email, so the result I'm expecting is:</p>
  
  <pre><code>id      email                 status       date
  6       user3@server.com      pending      2014-10-03
  7       user1@server.com      pending      2014-10-04
  9       user2@server.com      pending      2014-10-05
  </code></pre>
  
  <p>Any ideas how I can achieve this?<br />
  Thanks in advance.</p>