title: MYSQL - Group BY with MAX issue
body: <p>I have the following table </p>
  
  <pre><code>  Date, TelephoneNumber, Type
    02/02/12, 123456, b
    04/02/12, 123456, b
    07/02/12, 123456, a
    03/02/12, 789999, a
    15/02/12, 789999, b
  </code></pre>
  
  <p>When running the following SQL</p>
  
  <pre><code>        select TelephoneNumber, max(Date) as datetime, Type
          from Table1
          where Date &gt; '2012-03-25 00:00'
          group by TelephoneNumber
          order by date desc;
  </code></pre>
  
  <p>I noted that the Type does not match its related Date. For example I am getting </p>
  
  <pre><code>  07/02/12, 123456, b
    15/02/12, 789999, a
  </code></pre>
  
  <p>It seems that it is taking the first record in Type .... even when I sorted in the other way round. Can someone please help me how I can solve this problem? I am using MySQL</p>
  
  <p>Thanks in advance.
  sandro</p>