灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2944回复:0

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

楼主#
更多 发布于:2012-09-17 15:05



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

CREATE INDEX Syntax

CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
[index_type]
ON tbl_name (index_col_name,...)
[index_type]
 www.atcpu.com  
index_col_name:
col_name [(length)] [ASC | DESC]

index_type:
USING {BTREE | HASH | RTREE}

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

喜欢0 评分0
游客

返回顶部