且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在sql server中显示重复记录

更新时间:2023-01-22 16:22:45

您好,



请尝试以下查询:



Hello,

Please try below query:

select ContactID,SchoolID,COUNT(ContactID) as DuplicateNumbers from WorkingGroupSchoolContact
group by ContactID,SchoolID
Having COUNT(ContactID) > 1





此查询将返回组合中的所有重复记录ContactID和SchoolID。



如果您对此有任何疑虑或疑问或者我遗失了某些内容,请与我们联系。





谢谢



This query will return all the duplicate records in the combination of ContactID and SchoolID.

Please let me know if you have any concern or query on this or if I am missing something.


Thanks