假设字段为a,b,c
delete from 表 aa where (aa.a,aa.b,aa.c) in (select a,b,c from 表 group by a,b,c having count(*) >1) and rowid not in (select min(rowid) from 表 group by a,b,c having count(*)>1)
insert into T(AID,BID,……)SELECT AID,BID,……
FROM T1
WHERE NOT EXISTS (SELECT 1 FROM T AID=T1.AID AND BID=T1.BID)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)