checking for duplicates
if for example, you want to apply a unique index, but you can’t because there’s duplicates in the table.
SELECT name FROM mytable GROUP BY name HAVING COUNT(*) > 1;
if for example, you want to apply a unique index, but you can’t because there’s duplicates in the table.
SELECT name FROM mytable GROUP BY name HAVING COUNT(*) > 1;