我们如何删除多列UNIQUE索引?

与我们从表中删除UNIQUE约束一样,也可以删除多列UNIQUE索引。

示例

在此示例中,通过以下查询,我们删除了表“ employee”上的多列UNIQUE索引-

mysql> DROP index id_fname_lname on employee;
Records: 0 Duplicates: 0 Warnings: 0

可以从以下查询的结果集中观察到UNIQUE索引的删除-

mysql> show index from employee;
Empty set (0.00 sec)

mysql> describe employee;
+------------+-------------+------+-----+---------+-------+
| Field      | Type        | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| empid      | int(11)     | YES  |     | NULL    |       |
| first_name | varchar(20) | YES  |     | NULL    |       |
| last_name  | varchar(20) | YES  |     | NULL    |       |
+------------+-------------+------+-----+---------+-------+
3 rows in set (0.08 sec)