热门关键字:  ubuntu  分区  函数  Fedora  linux系统进程

oracle index

来源: 作者: 时间:2008-08-14 Tag: 点击:
1,创建索引index;若表中已经创建primary key或unique则不可再创建index.
   表结构:
SQL> desc test3;
 名称                                      是否为空? 类型
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL NUMBER(38)
 LNAME                                              VARCHAR2(20)
 FNAME                                              VARCHAR2(20)
SQL> create index testindex3
  2  on test3(id);
on test3(id)
         *
第 2 行出现错误:
ORA-01408: 此列列表已索引

手工在另外一个字段上创建索引;
SQL> create index testindex3
  2  on test3(lname);
索引已创建。
 
2,创建带有表达式的索引;如下将fname大写:
SQL> create index testindex31
  2  on test3(upper(fname));
索引已创建。
 
3,删除索引;
SQL> drop index testindex31;
索引已删除。

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册