对于Oracle还不熟悉,想问问大家如何在Oracle中创建临时表?
select a.a1,b.b2 from a,b where a.id=b.id
我就是想把select出来的东西创建成一个临时表,改如何写?
请教请教 最好写详细点,我还是菜鸟 呵呵

解决方案 »

  1.   

    create temporary table test
    as
    select a.a1,b.b2 from a,b where a.id=b.id
    on commit delete rows;
      

  2.   

    CREATE OR REPLACE VIEW V_TEST AS
            select a.a1,b.b2 from a,b where a.id=b.id
     
      

  3.   


    1,建表存储select数据
      create table a_select
      as 
      select a.a1,b.b2 from a,b where a.id=b.id 
      on commit delete rows; 
    2,如果是查询的话,而且不需要对查询出来的数据进行处理的话,建议用视图来放数据:
    create or replace view view_a as
    select a.a1,b.b2 from a,b where a.id=b.id
      

  4.   

    create temporary table test 
    as 
    select a.a1,b.b2 from a,b where a.id=b.id 
    on commit delete rows; 
      

  5.   

    人家要建临时表,说用View的人都是捣糨糊,忽悠