简体   繁体   中英

How to create an index based on 2 columns using the UNIQUE keyword in MySQL?

I know how to make it like this:

ALTER TABLE birdwatchers.humans
ADD INDEX human_names (name_last, name_first);

But how to do the same thing using the UNIQUE keyword ( my book asks me for that )?

您可以使用添加唯一:

Alter table birdwatchers.humans add unique human_names(name_last, name_first);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM