--创建或替换索引
create or replace view myview as
select d.name,d.lastlogon from d
--基于索引查询
select * from myview
完整代码:
-- Create table
create table D
(
ID VARCHAR2(20),
NAME VARCHAR2(10),
EMAILADDRESS VARCHAR2(30),
LASTLOGON DATE
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
--创建或替换索引
create or replace view myview as
select d.name,d.lastlogon from d
--基于索引查询
select * from myview
|