删除表中多余的重复记录,重复记录是根据单个字段(id)来判断,只留有id最小的记录
delete from Gy_Material
where mname+model in (select mname+model from Gy_Material group by mname+model having count(mname+model) > 1)
and id not in (select min(id) from Gy_Material group by mname+model having count(mname+model)>1)