关于视图
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';
本文介绍了数据库视图的概念及其多种用途,包括创建基本视图、带有检查条件的视图、多表连接视图以及只读视图等。通过具体示例展示了如何使用视图提高数据安全性及简化查询操作。
1060

被折叠的 条评论
为什么被折叠?



