title: How to delete last record(on condition) from a table in MySql
body: <p>I have a <strong>LoginTime</strong> table like this:</p>
  
  <pre><code>id | user_id | datetime
  1  |   1     | 2011-01-17 18:51:05
  2  |   1     | 2011-01-18 18:51:05  
  3  |   1     | 2011-01-19 18:51:05  
  4  |   2     | 2011-01-19 18:51:05  
  </code></pre>
  
  <p>I want to delete last record for <code>user_id=1</code>. Last record of a user can be recognized by <code>datetime</code>.</p>
  
  <p>How can I do this with one query. </p>