title: Wrong row value when ordering with GROUP BY
body: <p>i have a table (10k records) with matches history beetwen 2 players like this:</p>
  
  <pre><code>+----+---------+--------+-------------------+--------------------+------------+-----------+--+
  | id | Winner  | Losser | Winner_new_rating | Losser_new_rating  | (datetime) | matchname |  |
  +----+---------+--------+-------------------+--------------------+------------+-----------+--+
  |9999| Peter   | Wally  |           1200.34 |            1000.23 | 11.11.2013 | string    |  |
  |9998| Peter   | Sally  |           1190.23 |            1123.23 | 10.01.2013 | string    |  |
  |9997| Logan   | Demo   |            999.24 |            1222.23 | 11.11.2012 | string    |  |
  |9996| Hex     | Wally  |            750.34 |            1333.23 | 14.07.2012 | string    |  |
  |9995| Peter   | Sally  |           1180.45 |            1444.23 | 12.11.2011 | string    |  |
  |9994| Wayne   | Wally  |           1450.22 |            1555.23 | 11.05.2011 | string    |  |
  +----+---------+--------+-------------------+--------------------+------------+-----------+--+
  </code></pre>
  
  <p>I am tryin to get from it history highest peaks grouped by player. Somehow when im doin this:</p>
  
  <pre><code>SELECT Winner, Losser, MAX(Winner_new_rating) AS maxrating, datetime, matchname
  FROM
         ( SELECT * 
           FROM gamelist
           ORDER BY Winner_new_rating
         ) AS innerTable
  GROUP BY Winner
  ORDER BY maxrating DESC
  LIMIT 100
  </code></pre>
  
  <p>I get almost fine output except datetime and matchname seems to be taken from random record. </p>
  
  <p>Becouse i want to output like a ranking with history highest peaks i need proper game date and matchname (in real its tounament name), to show when this player hited his best peak.</p>
  
  <p>ex what i need:</p>
  
  <pre><code>Greg  / 1455.99 / date of this game when he reached his max rating / matchname
  Peter / 1234.23 / date of this game when he reached his max rating / matchname
  Wally / 1199.22 / date of this game when he reached his max rating / matchname
  Sally / 1173.11 / date of this game when he reached his max rating / matchname
  Demon / 1011.22 / date of this game when he reached his max rating / matchname
  Omen  /  999.13 / date of this game when he reached his max rating / matchname
  </code></pre>
  
  <p>...</p>
  
  <p>Of course in datetime column is datetime format, this is just example.</p>
  
  <p>No idea how to do it better. Thank you in advance.</p>