Query for finding duplicate entries from table

Following is the example which finds the duplicate entries from candidates table based on mobile column:


select * from candidates where mobile in (select mobile from candidates group by mobile having count(mobile) > 1)
order by mobile

OR

SELECT * FROM candidates
INNER JOIN (SELECT mobile FROM candidates
GROUP BY mobile HAVING count(mobile) > 1) dup ON candidates.mobile = dup.mobile

Leave a comment