I have a table [user_logs] with the following fields [username], [datetimelog]
Sample Data
============== user1 2011-06-28 08:49:01 user2 2011-06-28
What about:
DELETE FROM MY_TABLE M -- delete from the table LEFT JOIN MY_TABLE M2 ON M.user = M2.user -- table needs to be joined TO ITSELF WHERE NOT M.LOG_DATE = MAX( M2.LOG_DATE ) -- Anything which isn't MAX goes.
Could that work?