I have a fairly simple test database:
id email 1 [email protected] 2 [email protected] 3 [email protected] 4 [email protected] 5 [email protected] 6 [email protected] 7 [email protected] 8 [email protected] 9 [email protected] I want to remove duplicates which should alter the table to:
id email 1 [email protected] 2 [email protected] 3 [email protected] 5 [email protected] 7 [email protected] 8 [email protected] Or with a new id it does not matter.
I stumbled upon this titbit:
mysqli_query($con,"ALTER IGNORE TABLE mytest ADD UNIQUE (email,id)"); But, alas, it does nothing. What am I doing wrong?
ALTER IGNORE TABLE my_table ADD UNIQUE(email)Tested and confirmed.