Check duplicates for combination of multiple columns

If you have combination of multiple columns that you want to check duplicates. 

For example : Check duplicates for combination of

 AGE,NAME,SEX,DOB,CITY

Sql will be :

select AGE,NAME,SEX,DOB,CITY,count(1) 
from Employees 
group by AGE,NAME,SEX,DOB,CITY 
having count(1) >1;

Comments

Popular posts from this blog

chr function and its values - CHR and ASCII values

ORACLE FAL_CLIENT and FAL_SERVER explained

IMPDP TABLE_EXISTS_ACTION = APPEND, REPLACE, [SKIP] and TRUNCATE