zoukankan      html  css  js  c++  java
  • mysql 索引

    drop index name on table_test ;

    创建表时直接设置:

    DROP TABLE IF EXISTS `student`;
    CREATE TABLE `student` (
      `stu_id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(255) DEFAULT NULL,
      PRIMARY KEY (`stu_id`),
      UNIQUE KEY `UK_student_name` (`name`) 
    ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;



    ALTER TABLE t_repay_portion DROP index account_no_loan_code_period;
    alter table t_repay_portion add unique index account_no_loan_code_frozen_order_id_period(account_no,loan_code,frozen_order_id,period);


    创建唯一索引:

    create unique index UK_student_name on student (name);

    建表后添加约束:

    alter table student add constraint uk_student_name unique (name);

  • 相关阅读:
    21.扩展
    20.嵌套类型
    19.类型转换
    18.错误处理
    17.可选链
    16.ARC
    15.析构函数
    14.构造函数
    13.继承
    12.下标
  • 原文地址:https://www.cnblogs.com/Struts-pring/p/10819643.html
Copyright © 2011-2022 走看看