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

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

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

  2020-12-15 我要评论
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}
复制代码 代码如下:

-- 创建无索引的表格
create table testNoPK (
id int not null,
name varchar(10)
);
-- 创建普通索引
create index IDX_testNoPK_Name on testNoPK (name);

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们