create view v_name as
select * from a,b,c
where ...;
select * from a,b,c
where ...;
解决方案 »
- 我想在winxp下安装一个最简单的oracle环境,怎么做?
- oracle 数据恢复
- linux下如何每天自动备份oracle数据库,高手请进
- 2表查询求SQL语句
- 控制文件路径
- pl/sql dev 中test window 和 sql window编写脚本有什么差别???
- 嵌套select语句时,如果内层select查询结果有重复列名,则外层无法用select *,如何解决
- LOB 定位器无法扩展事务处理
- 存储过程怎么写
- 从sqlserver中往oracle中倒数据,总是因为乱码而进行不下去,能不能忽略呢???或是有别的办法????
- 关于监听器的错误!
- 新手求救,vb6连接oracle的问题(100分)
table b (b1,b2,b3,b4);
table c (c1,c2,c3,c4);table d (d1 varchar2,d1 clob,d2 blob);d表是a,b,c的关联表我现在已经建立视图aview
create view aview as
(
select a.a1,a.a2,a.a3,a.a4,b.d1,b.d2
from a a,d b
where
a.a1=b.d1
);create view bview as
(
select b.b1,b.b2,b.b3,b.b4,b.d1,b.d2
from b a,d b
where
b.b1=b.d1
);
...现在想做的是把几张表的信息放到同一个view中,然后可以通过一条“select * from superview;”来查询几张表的信息!
as
( select * from a
where ....
union all
select * from b
where ....
union all
select * from c
where ....);是这样吗?
select
(select a1 from a where a.a1=b.b1 and a.a1=c.c1)||
(select b1 from b where a.a1=b.b1 and a.a1=c.c1)||
(select c1 from c where a.a1=b.b1 and a.a1=c.c1) field1,
select a2 from a where a.a1=b.b1 and a.a1=c.c1)||
(select b2 from b where a.a1=b.b1 and a.a1=c.c1)||
(select c2 from c where a.a1=b.b1 and a.a1=c.c1) field2,
select a3 from a where a.a1=b.b1 and a.a1=c.c1)||
(select b3 from b where a.a1=b.b1 and a.a1=c.c1)||
(select c3 from c where a.a1=b.b1 and a.a1=c.c1) field3
from a,b,c where a.a1=b.b1 and a.a1=c.c1 ;