oracle建视图

来源:百度知道 编辑:UC知道 时间:2024/06/17 06:35:46
现在又3张表:文件表 人员表 类型表
文件表:id title content userid typeid
人员表:id user
类型表:id type
我想做到做一个试图显示title content user type
请问大虾们怎么做呢?
小弟感激不尽

不要有重复的数据

create view view_join
as
select distinct
a."title",a."content",b."user",c."type"
from
文件表 a, 人员表 b, 类型表 c
where
a.userid=b.id
and a.typeid=c.id
;

create view v_join
as
select
a."id",a."title",a."content",b."user",c."type"
from
文件表 a, 人员表 b, 类型表 c
where
a.userid=b.id (+)
and a.typeid=c.id(+)