关于视图
1、什么是视图
视图实际上是一条查询语句,是数据的显示方式
2、视图的作用
安全
方便
一致性
例子1:
create or replace view myview
as
select * from abc;
例子2:设定检测添加数据
create or replace view myview
as
select * from abc where C>=100
with check option
/
例子3:两表合并查询
create or replace view v_d
as
select e.eid,e.ename,e.sex,d.name from e,d where
e.id=d.id;
例子4:with read only只能读
create or replace view v_read
as
select eid,ename from emp
with read only;
查询 desc dba_views
desc all_views
desc user_views
select text from user_views where view_name='v_read';