¡¡¡¡mysql µÄΨһË÷ÒýÒ»°ãÓÃÓÚ²»Öظ´µÄ×ֶΣ¬Ò»°ã»á°Ñ±íÖеÄidÉèΪΨһË÷Òý£¬´´½¨Î¨Ò»Ë÷ÒýµÄÄ¿µÄ²»ÊÇΪÁËÌá¸ß²éѯËٶȣ¬¶øÊÇΪÁ˱ÜÃâÊý¾ÝÖظ´£¬×¢Ò⣺ΨһË÷Òý¿ÉÒÔÓжà¸ö£¬µ«ÊÇÁÐÖµ±ØÐëΨһ£¬´´½¨Î¨Ò»Ë÷ÒýʹÓùؼü×Öunique¡£
¡¡¡¡´´½¨Î¨Ò»Ë÷Òý
1£¬´´½¨±íµÄʱºò´´½¨Ë÷Òý£º
create table temp2(id int(10) not null auto_increment,title varchar(10) not null,cnt int(10) not null,primary key(`id`),index(`title`),unique key cnt(`cnt`)) engine=myisam;
2£¬Ìí¼ÓË÷Òý
¡¡¡¡
create unique index title on article(`title`);
3,
alter table article add index content(`content`);
Ö÷¼üË÷ÒýÊÇÌØÊâµÄΨһË÷Òý