title: How to select row with the latest timestamp from duplicated rows in a database table?
body: <p>I have a table with duplicate &amp; triplicate rows - how do I select the rows that are duplicated but have the latest timestamp as well as the un-duped rows?</p>
  
  <pre><code> -------------------------------------
  | pk_id | user_id | some_timestamp    |
  |-------------------------------------|
  | 1     | 123     | 10-Jun-12 14.30   |
  | 2     | 123     | 19-Jun-12 21.50   |
  | 3     | 567     | 10-Jun-12 09.23   |
  | 4     | 567     | 12-Jun-12 09.45   |
  | 5     | 567     | 13-Jun-12 08.40   |
  | 6     | 890     | 13-Jun-12 08.44   |
   -------------------------------------
  </code></pre>
  
  <p>So that I end up with:</p>
  
  <pre><code> -------------------------------------
  | pk_id | user_id | some_timestamp    |
  |-------------------------------------|
  | 2     | 123     | 19-Jun-12 21.50   |
  | 5     | 567     | 13-Jun-12 08.40   |
  | 6     | 890     | 13-Jun-12 08.44   |
   -------------------------------------
  </code></pre>