create view v_name as
select * from a,b,c
where ...;

解决方案 »

  1.   

    table a (a1,a2,a3,a4);
    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;”来查询几张表的信息!
      

  2.   

    就是把a表中a1,b中b1,c中c1作为superview中的一个字段,其他字段项类似!
      

  3.   

    create or replace view superview
    as
    ( select * from a
      where ....
      union all
      select * from b
      where ....
      union all 
      select * from c
      where ....);是这样吗?
      

  4.   

    首先必须保证所有字段都为字符串,各表以a1,b1,c1关联:
    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 ;