删除表中重复数据,留下ID比较小的行
delete from 表 where [重复字段] in (select [重复字段] from 表 group by 字段 having count([字段]) > 1) and ID not in (select min(ID) from [表] group by [字段] having count([字段])> 1)
时间: 2024-10-26 12:25:04
删除表中重复数据,留下ID比较小的行
delete from 表 where [重复字段] in (select [重复字段] from 表 group by 字段 having count([字段]) > 1) and ID not in (select min(ID) from [表] group by [字段] having count([字段])> 1)