我同时操作N张表中的字段,是用临时表把数据存起来快还是我建一个视图,直接去查询视图比较快?数据量很大!

解决方案 »

  1.   

    事务级临时表
    视图实际上还是要访问相关的表,还是会遇到ora-01555等等情况
      

  2.   

    insert into temptab select a.col1,b.col2,c.col3 from table1 a,table2 b,table3 c
    where a.id=b.id and b.id=c.id;
      

  3.   

    当然需要先创建了。insert into temptab(col1,col2,col3) select a.col1,b.col2,c.col3 from table1 a,table2 b,table3 c where a.id=b.id and b.id=c.id;
      

  4.   

    创建事务级临时表:create global temporary table classes(class_id number(5),class_name varchar2(8)) on commit delete rows ;
      

  5.   

    create global temporary table 表名(id number(5),name varchar2(8)) on commit delete rows;是不是这样直接增加的,好像有报错呀!
      

  6.   

    table or view does not exist报这个错  temporary 好像这个关键字有问题吧!
      

  7.   

    tgm78() 我操作出问题了,你看看我上面写的是对的吗?