delete from tbndfuture
where rowid not in
(
select max(rowid) from tbndfuture group by i_code having count(*)>1
union
select max(rowid) from tbndfuture group by i_code having count(*)=1
)
原文:https://www.cnblogs.com/joesenno1/p/15044040.html