delete from tb_table where id not in (select maxid from (select max(id) as maxid from tb_table group by sample_code) b);
tb_table:表名;
id,sample_code:列名