title: SQL SELECT not behaving as expected when using MIN() and GROUP BY
body: <p>I have a simple online leaderboard which also encodes replays in a string. Although the leaderboard stores every laptime reported (currently), the retrieval php just returns the best times for each unique player, thus:</p>
  <pre><code>SELECT driver
       , MIN(time)
       , track
       , replay 
    FROM Laptimes 
   WHERE track = '$track'
   GROUP 
      BY driver 
   ORDER 
      BY MIN(time) ASC 
   LIMIT 10
  </code></pre>
  <p>This correctly reports the fastest laptime, but does NOT select the replay associated with that laptime.</p>
  <p>Instead you just get the first replay submitted for that driver.</p>
  <p>I'm 100% sure the replays are correctly stored in the database, because if I remove the MIN() I get every laptime by every player, and can watch each replay without any problem.</p>
  <p>I just can't seem to convince SQL to give me the replay associated with the minimum laptime.</p>