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

RMAN-06820: WARNING: failed to archive current log at primary database

ORACLE FAL_CLIENT and FAL_SERVER explained