当前位置: 移动技术网 > IT编程>数据库>Mysql > MySQL 创建索引(Create Index)的方法和语法结构及例子

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

2017年12月12日  | 移动技术网IT编程  | 我要评论
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);

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网