How to find duplicate entries in a table
Recently I needed to find duplicate entries for some employees on my table. Here is a handy query
SELECT `pid`, COUNT(`pid`) AS Nummber_of_Occurrences FROM employees GROUP BY `pid` HAVING ( COUNT(`pid`) > 1 )