How-to find duplicates in SQL table on certain fields

Here is SELECT statement to find duplicates in SQL table on certain fields:

SELECT `field1`, `field2`, COUNT( * ) 
FROM `table`
GROUP BY `field2`
HAVING COUNT( * ) >1

 

Tags: sql (en)

PrintEmail

Add comment


Security code
Refresh