delete from t where id not in (select max(id) from t group by name)