如何删除多列唯一索引?
多列唯一索引也可以按照我们从表中移除唯一约束的方式移除。
示例
在此示例中,使用以下查询,我们已从表“employee”中移除多列唯一索引 −
mysql> DROP index id_fname_lname on employee; Query OK, 0 rows affected (0.30 sec) Records: 0 Duplicates: 0 Warnings: 0
以下查询的结果集中可以看到已移除唯一索引 −
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)
广告