MySQL 创建索引(Create Index)的方法和语法结构及例子
MySQL 创建索引(Create Index)的方法和语法结构及例子
发布时间:2016-12-29 来源:查字典编辑
摘要:CREATEINDEXSyntaxCREATE[UNIQUE|FULLTEXT|SPATIAL]INDEXindex_name[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}

复制代码 代码如下:

-- 创建无索引的表格

create table testNoPK (

id int not null,

name varchar(10)

);

-- 创建普通索引

create index IDX_testNoPK_Name on testNoPK (name);

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新mysql数据库学习
热门mysql数据库学习
编程开发子分类