title: ORDER BY date and time BEFORE GROUP BY name in mysql
body: <p>i have a table like this:</p>
  
  <pre><code>name    date         time
  tom | 2011-07-04 | 01:09:52
  tom | 2011-07-04 | 01:09:52
  mad | 2011-07-04 | 02:10:53
  mad | 2009-06-03 | 00:01:01
  </code></pre>
  
  <p>i want oldest name first: </p>
  
  <pre><code>SELECT * 
  ORDER BY date ASC, time ASC 
  GROUP BY name
  </code></pre>
  
  <p>(->doesn't work!)</p>
  
  <p>now it should give me first mad(has earlier date) then tom</p>
  
  <p>but with <code>GROUP BY name ORDER BY date ASC, time ASC</code> gives me the newer mad first because it groups before it sorts!</p>
  
  <p>again: the problem is that i can't sort by date and time before i group because GROUP BY must be before ORDER BY!</p>