创建表
CREATE TABLE tb_user (
id int primary key auto_increment,
user_name varchar(50),
password varchar(20),
pkfields varchar(100)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1、唯一索引
ALTER TABLE tb_user ADD UNIQUE (user_name, pkfields);
创建表
CREATE TABLE tb_user (
id int primary key auto_increment,
user_name varchar(50),
password varchar(20),
pkfields varchar(100)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1、唯一索引
ALTER TABLE tb_user ADD UNIQUE (user_name, pkfields);