查找表中多余的重复记录
select *
from data_tax_digital_stamps t
where (t.certificatenm) in (select t.certificatenm
from data_tax_digital_stamps t
group by t.certificatenm
having count(*) > 1);
删除表中多余的重复记录,只留有rowid最小的记录
delete from data_tax_digital_stamps t
where (t.certificatenm) in (select t.certificatenm
from data_tax_digital_stamps t
group by t.certificatenm
having count(*) > 1)
and rowid not in (select min(rowid)
from data_tax_digital_stamps t
group by t.certificatenm
having count(*) > 1)