В MySQL вы можете использовать join
в delete
:
delete t
from thistable t join
(select Application_Id, External_Account_Id,
max(Last_Warning_Message) as max_Last_Warning_Message
from thistable t
group by Application_Id, External_Account_Id
) tt
on t.Application_Id = tt.Application_Id and
t.External_Account_Id = tt.External_Account_Id and
t.Last_Warning_Message < tt.max_Last_Warning_Message;