最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
sql创建表索引 create index()语句
时间:2011-01-14 编辑:简简单单 来源:一聚教程网
sql创建表索引 create index()语句
mssql server 方法
语法:
create [索引类型] index 索引名称
on 表名(列名)
with fillfactor = 填充因子值0~100
go
实例
create nonclustered index ix_test_tname --创建一个非聚集索引
on test(tname) --为test表的tname字段创建索引
with fillfactor = 30 --填充因子为30%
go
select * from test(index = ix_test_tname) where tname = 'a'
mysql教程 方法
mysql创建索引语法
create [unioun|fulltext|spatial] index indexname[using indextype] on
tablename( tablenamecol)
index_col_name:
col_name[ (length)][asc |desc]
更多详细内容请查看:http://www.111com.net/database/110/mysql-crate-
index.htm
实例
create index 实例
本例会创建一个简单的索引,名为 "personindex",在 person 表的 lastname 列
:
create index personindex
on person (lastname)
如果您希望以降序索引某个列中的值,您可以在列名称之后添加保留字 desc:
create index personindex
on person (lastname desc)
假如您希望索引不止一个列,您可以在括号中列出这些列的名称,用逗号隔开:
create index personindex
on person (lastname, firstname)
相关文章
- mssql创建视图索引方法详解 10-19
- mssql 唯一索引和约束 讲述 09-08
- sql 视图、约束、索引创建方法 07-06
- sql入门教程:create index创建索引 11-21
- 维护Sql Server中表的索引 01-24
- 在SQL2k降序索引上使用中bug 01-12