I have a table with duplicate and triple rows - how can I select duplicate rows, but have the last timestamp, as well as rows without duplication?
------------------------------------- | 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 | -------------------------------------
So, I get:
------------------------------------- | 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 | -------------------------------------
blank
source share