Saturday 22 February 2014

Finding Duplicates In TERADATA

How to find the duplicate rows in the table in Teradata?

Group by those fields and add a count greater than 1 condition for those columns
For example –
SELECT name, COUNT (*) FROM TABLE EMPLOYEE GROUP BY name HAVING COUNT (*)>1;

Also  DISTINCT will be useful. If both DISTINCT and COUNT(*) returns same number then there are no duplicates.

No comments:

Post a Comment