Search

Wednesday, January 4, 2012

Finding duplicates


Use the below query to find all the duplicate records within the tables. Here we are looking for the duplicate Name in the Customer Table.

Example:

SELECT Name, COUNT(Name) AS Total FROM CustomerMaster GROUP BY Name
HAVING
(COUNT(Name) > 1 )

No comments:

Post a Comment