gur*_*ru 6 sql oracle oracle10g oracle11g
当我在视图上创建索引时,它显示以下错误:
ORA-01702: 此处不适合视图
create view xx_emp for select * from emp;
Run Code Online (Sandbox Code Playgroud)
背后的原因是什么?
定义 TABLE 列上的索引(例如 EMP.EMP_ID)
create index emp_idx on emp (emp_id);
Run Code Online (Sandbox Code Playgroud)
并在查询视图时使用它
select * from xx_emp where emp_id = 1;
Run Code Online (Sandbox Code Playgroud)
这不适用于复杂的视图,但对于简单的情况,索引将(在大多数情况下)用于访问数据。
| 归档时间: |
|
| 查看次数: |
33505 次 |
| 最近记录: |