title: MySQL sorting by date with GROUP BY
body: <p>My table <code>titles</code> looks like this</p>
  
  <pre><code>id |group|date                |title
  ---+-----+--------------------+--------
  1  |1    |2012-07-26 18:59:30 | Title 1
  2  |1    |2012-07-26 19:01:20 | Title 2
  3  |2    |2012-07-26 19:18:15 | Title 3
  4  |2    |2012-07-26 20:09:28 | Title 4
  5  |2    |2012-07-26 23:59:52 | Title 5
  </code></pre>
  
  <p>I need latest result from each group ordered by date in descending order. Something like this</p>
  
  <pre><code>id |group|date                |title
  ---+-----+--------------------+--------
  5  |2    |2012-07-26 23:59:52 | Title 5
  2  |1    |2012-07-26 19:01:20 | Title 2
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>SELECT *
  FROM `titles`
  GROUP BY `group`
  ORDER BY MAX( `date` ) DESC
  </code></pre>
  
  <p>but I'm geting first results from groups. Like this</p>
  
  <pre><code>id |group|date                |title
  ---+-----+--------------------+--------
  3  |2    |2012-07-26 18:59:30 | Title 3
  1  |1    |2012-07-26 19:18:15 | Title 1
  </code></pre>
  
  <p>What am I doing wrong?
  Is this query going to be more complicated if I use LEFT JOIN?</p>