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
DELETE FROM table a WHERE time != (SELECT MAX(time) FROM table b WHERE b.user=a.user);
Here delete a row, if its not the maximum time in group with the same user_id