title: MySQL select last row each day
body: <p>Trying to select last row each day. </p>
  
  <p>This is my (simplified, more records in actual table) table:</p>
  
  <pre><code>+-----+-----------------------+------+
  | id  |       datetime        | temp |
  +-----+-----------------------+------+
  |  9  | 2017-06-05 23:55:00   | 9.5  |
  |  8  | 2017-06-05 23:50:00   | 9.6  |
  |  7  | 2017-06-05 23:45:00   | 9.3  |
  |  6  | 2017-06-04 23:55:00   | 9.4  |
  |  5  | 2017-06-04 23:50:00   | 9.2  |
  |  4  | 2017-06-05 23:45:00   | 9.1  |
  |  3  | 2017-06-03 23:55:00   | 9.8  |
  |  2  | 2017-06-03 23:50:00   | 9.7  |
  |  1  | 2017-06-03 23:45:00   | 9.6  |
  +-----+-----------------------+------+
  </code></pre>
  
  <p>I want to select row with id = 9, id = 6 and id = 3. </p>
  
  <p>I have tried this query:</p>
  
  <pre><code>SELECT MAX(datetime) Stamp
       , temp 
    FROM weatherdata 
   GROUP 
      BY YEAR(DateTime)
       , MONTH(DateTime)
       , DAY(DateTime) 
   order 
      by datetime desc 
   limit 10;
  </code></pre>
  
  <p>But datetime and temp does not match.</p>
  
  <p>Kind Regards</p>