请教:
如何写这样的存储过程,某个列都是空,执行存储过程后,该列顺序加一?
比如
原表是字段A是FLOAT型,都是空值,执行存储过程后变成
A
1
2
3
4
5
6
.
.
.
请高手赐教:)

解决方案 »

  1.   

    update test
        set a=(
        select rownum rn
          from test
        )
      

  2.   

    update table set A = rownum
      

  3.   

    如果你的a有部分字段有了,新的加在MAX+1开始的话可以这样
    update test
        set a=(
        select b.max_a+rownum rn
          from test a,
          (select max(a) max_a
            
             from test
           ) b
           where a.a is null
        )
      

  4.   

    create table test
    (
     id varchar(20),
     num float;
    );
    Update test Set num=Rownum;
      

  5.   

    update table set a=rownum;
      

  6.   

    update table set a=rownum; 正解
      

  7.   

    create table test 

    id varchar(20), 
    num float; 
    ); 
    Update test Set num=Rownum;