Add IGNORE to the statement, then use SELECT to have a look at the table contents to see how the duplicates ha
ve been removed:
mysql>
mysql> CREATE TABLE mytbl
-> (
-> i INT,
-> c CHAR(1)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
mysql> ALTER IGNORE TABLE mytbl ADD UNIQUE (i,c);
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>
mysql> drop table mytbl;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category