query count duplicates mysql code example
Example 1: find duplicates mysql column
SELECT name, COUNT(*) c FROM table GROUP BY name HAVING c > 1;
Example 2: mysql remove duplicates
DELETE FROM table_name WHERE id
NOT IN ( SELECT id FROM table_name
GROUP BY field_1, field_2)