title: mysql group by and sort each group
body: <p>I have the following table:</p>
  
  <pre>ID NAME TIME
  1  A    0
  2  A    3
  3  B    1</pre>
  
  <p>I am using the query below which produces:</p>
  
  <pre><code>SELECT * FROM `table` GROUP BY `NAME`
  </code></pre>
  
  <pre>ID NAME TIME
  1  A    0
  3  B    1</pre>
  
  <p>And I want use <code>GROUP BY</code> to generate a result like this (discount sort by the TIME column):</p>
  
  <pre>ID NAME TIME
  2  A    3
  3  B    1</pre>