删除重复的记录

delete from ucs_projectno_pms    
where uniqueid in (select uniqueid from ucs_projectno_pms group by uniqueid   having count(uniqueid) > 1)   
and rowid not in (select min(rowid) from ucs_projectno_pms group by uniqueid having count(uniqueid )>1)

你可能感兴趣的:(delete)