易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL如何创建索引 - MS-SQL Server / 基础类

能详细说一下SQL创建索引的语法吗?
SQL code:
CREATE INDEX
为给定表或视图创建索引。

只有表或视图的所有者才能为表创建索引。表或视图的所有者可以随时创建索引,无论表中是否有数据。可以通过指定限定的数据库名称,为另一个数据库中的表或视图创建索引。

语法
CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name
ON { table | view } ( column [ ASC | DESC ] [ ,...n ] )
[ WITH < index_option > [ ,...n] ]
[ ON filegroup ]

< index_option > ::=
{ PAD_INDEX |
FILLFACTOR = fillfactor |
IGNORE_DUP_KEY |
DROP_EXISTING |
STATISTICS_NORECOMPUTE |
SORT_IN_TEMPDB
}



2000的

有点儿长,所以请查看联机丛书
create index

http://msdn.microsoft.com/zh-cn/library/ms188783.aspx
参考这个吧!

太多 自己看MSDN

SQL code:
--非聚集:create index 索引名 on 表名(字段名) --也可以是字段名列表(复合索引)
--聚集:create clustered index 索引名 on 表名(字段名)
--唯一:create unique index 索引名 on 表名(字段名)--也可以是字段名列表(复合索引)
...


-----创建索引

create clustered index riqi_person on person(date)
------在person表的date字段上面创建名为riqi_person的【聚集索引】

create nonclustered index riqi_person


相关问答:

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

sql小小的疑问 - .NET技术 / C#

可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......

两句SQL并一句,有问题. - MS-SQL Server / 基础类

第一句:
select ht.gfdm,gfdm.gfmc,gfdm.lb ,sum(jh.htdj*jh.htsl)as je
from ht left join gfdm on ht.gfdm=gfdm.gfdm 
 join jh on ht.htbh=jh.hth 
and ht.htbh not like'del%' and ht. ......

关于SQL查询语句的问题 - MS-SQL Server / 疑难问题

请问如何实现如下查询
数据如下:
id name level
1 甲 1
2 甲 2
3 乙 1
4 乙 2
5 乙 3
6 丁 2
希望结果如下:
name level count
甲 1 1/2
甲 2 1/3
乙 1 1/2
乙 2 1/3
乙 3 1
丁 2 1/3
拜托了:) ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号