Archive for the ‘MySQL’ Category

checking for duplicates

Friday, May 8th, 2009

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;