知识改变人生

MySQL 创建索引(Create Index)的方法和语法结构及例子

MySQL 创建索引(Create Index)的方法和语法结构及例子

CREATE INDEX Syntax

CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name

[index_type]

ON tbl_name (index_col_name,…)

[index_type]

index_col_name:

col_name [(length)] [ASC | DESC]

index_type:

USING {BTREE | HASH | RTREE}

  1. — 创建无索引的表格
  2. create table testNoPK (
  3. id int not null,
  4. name varchar(10)
  5. );
  6. — 创建普通索引
  7. create index IDX_testNoPK_Name on testNoPK (name);
赞(0)
未经允许不得转载:很文技术博客 » MySQL 创建索引(Create Index)的方法和语法结构及例子

评论 抢沙发