delete * from (select a.*,a.rowid from table a where rowid !=(select max(rowid) from table b where a.apply_id=b.apply_id and a.user_id=b.user_id))