Chinaunix首页 | 论坛 | 博客
  • 博客访问: 240522
  • 博文数量: 49
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 530
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-06 08:57
文章分类

全部博文(49)

文章存档

2009年(5)

2008年(44)

我的朋友

分类: WINDOWS

2008-08-13 09:41:48

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;
索引已删除。
阅读(1248) | 评论(0) | 转发(0) |
0

上一篇:oracle sequence

下一篇:oracle synonyms同义词

给主人留下些什么吧!~~