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:列名
如果觉得《mysql 删除重复记录 只保留id字段值最大的记录》对你有帮助,请点赞、收藏,并留下你的观点哦!
时间:2023-05-04 14:42:08
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:列名
如果觉得《mysql 删除重复记录 只保留id字段值最大的记录》对你有帮助,请点赞、收藏,并留下你的观点哦!