Home > Database > Mysql Tutorial > mysql创建单个和联合索引

mysql创建单个和联合索引

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:20:30
Original
1225 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 首先创建一个表:create table t1 (id int primary key,username varchar(20),password varchar(20)); 创建单个索引的语法:create index 索引名 on 表名(字段名) 索引名一般是:表名_字段

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  首先创建一个表:create table t1 (id int primary key,username varchar(20),password varchar(20));

  创建单个索引的语法:create index 索引名 on 表名(字段名)

  索引名一般是:表名_字段名

  给id创建索引:create index t1_id on t1(id);

  创建联合索引的语法:create index 索引名 on 表名(字段名1,字段名2)

  给username和password创建联合索引:create index t1_username_password on t1(username,password)

mysql创建单个和联合索引

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template