3,490
社区成员
发帖
与我相关
我的任务
分享
select * from tb a join(
select repeatColumnA,repeatColumnB,repeatColumnN from tb
group by repeatColumnA,repeatColumnB,repeatColumnN
having count(*)>1
)b on a.repeatColumnA=b.repeatColumnA
and a.repeatColumnB=b.repeatColumnB
and a.repeatColumnN=b.repeatColumnN;
delete from 1张表 a
where exists (select 1 from 1张表 where 数据b=a.数据b and 数据c=a.数据c and 数据a<a.数据a)
--重复数据只显示一条:
select min(id) id,b,c from tb group by b,c
--删除重复数据:
delete from tb where rowid not in (select min(rowid) from tb group by b,c);