table_users( id INT PRIMARY KEY, username TEXT ); delete from table_users USING table_users, table_users as vtable WHERE (table_users.id > vtable.id) AND (table_users.username=vtable.username)
(table_users.id > vtable.id) - should return only one row