(sql笔记)如何查重

如何在数据量大的时候找到重复的数据?

select  id,SchemeId as s from orderaction
GROUP BY SchemeId
HAVING COUNT(s)>1

***要是上面看不懂,可以添加count()函数计数***

select  id,count(SchemeId) as s from orderaction
GROUP BY SchemeId
HAVING COUNT(s)>1

 

posted @ 2024-10-29 15:30  茫茫人海中的一颗沙尘  阅读(2)  评论(0编辑  收藏  举报