delete from tablename a where rowid > ( select min(rowid) from table_name b where b.id = a.id and b.name=a.name);