title: Group by max date and id
body: <p>I have the following table:</p>
  
  <pre><code> id         value       date
   ---------  ---------  ----------
   1          324          2017-05-19 02:00:00
   2          564          2017-05-19 04:00:00
   3          675          2017-05-19 03:00:00
   3          642          2017-05-19 05:00:00
   4          642          2017-05-19 07:00:00
   5          642          2017-05-19 06:00:00
   6          642          2017-05-19 05:00:00
   6          642          2017-05-19 12:00:00
   7          642          2017-05-19 01:00:00
   8          642          2017-05-19 13:00:00
   8          642          2017-05-19 02:00:00
  </code></pre>
  
  <p>I want to <code>GROUP BY</code> the <code>id</code> column but also select the <code>value</code> and <code>date</code> column from the first row when ordered by <code>date</code> descending, with that <code>id</code>.</p>
  
  <p>The result should be like this:</p>
  
  <pre><code> id         value       date
   ---------  ---------  ----------
   1          324          2017-05-19 02:00:00
   2          564          2017-05-19 04:00:00
   3          642          2017-05-19 05:00:00
   4          642          2017-05-19 07:00:00
   5          642          2017-05-19 06:00:00
   6          642          2017-05-19 12:00:00
   7          642          2017-05-19 01:00:00
   8          642          2017-05-19 13:00:00
  </code></pre>