select FID=identity(int,1,1),a,b,c
into #B
from A; 这个SQL换成oracle怎么写呀?

解决方案 »

  1.   

    insert into b select rownum,a,b,c from A;
      

  2.   


    insert into b select row_number() over(order by a , b, c) fid , a, b, c from a
      

  3.   

    如果你的sql结果是按条取序号的话
    可以
    insert into b select rownum,a,b,c from (select a,b,c from A order by a,b,c);
      

  4.   

    insert into B select rownum,a,b,c from A
      

  5.   

    create table B as select rownum fid, a, b, c from A;
      

  6.   

    Oracle中的自动增长列是要用序列号的  
    楼主的意思是把表 A 的数据创建入 #B 中..顺便插入自动增长列FID吧...
    创建序列号
    create sequence emp_FID
    start with 1    --序列号初始值
    increment by    --序列号进步幅度
    nomaxvalue      --序列号的最大值  (此参数为不设置最大值)
    nocycle;        --序列号到达最大值时将不再增加序号select FID=emp_FID.nextval,a,b,c
    into #B
    from A;LZ试一试吧   
    咱也是初学来着..
      

  7.   

    increment by  1  --序列号进步幅度