Reputation: 58
I have a table that contain two column PropertyID and DistrictID what I need is to find duplicate that match each PropertyID and DistrictID. I mean each PropertyID and DistrictID repeated together. please any help well be appreciated.
Upvotes: 1
Views: 99
Reputation: 460108
You have to group by these columns:
SELECT PropertyID, DistrictID
FROM dbo.TableName
GROUP BY PropertyID, DistrictID
HAVING COUNT(*) > 1
Upvotes: 4