PROVE IT !!If you know it then PROVE IT !! Skill Proficiency Test

How to find duplicates in a table?

3) How to find duplicates in a table?
Answers)
To find duplicates in the table , we can use group by function on those columns which are to be used and then listing them if their count is >1 .

Following sample query can be used to find duplicates in table having 3 columns

select col1, col2,col3, count(*) from table
group by col1, col2, col3
having count (*) > 1 ;

Add a Comment

Your email address will not be published. Required fields are marked *