alter table tbl add no varchar(10);
update tbl set no=id
alter table tbl drop column id

解决方案 »

  1.   

    oracle9i中可以用
     alter table 表名  rename column  旧的属性名  to  新的属性名;oracle9i之前的好像不行,可以曲线更改
    alter table 表名  add  新字段    (你想改成的)
    update  表名  set  新字段=旧字段   (赋值)
    alter table  表名  drop  column 老字段    (删除原来的)
      

  2.   

    to: gaop(鹏鹏) SQL> alter table bc rename column ac to aa
      2  ;
    alter table bc rename column ac to aa
                          *
    ERROR at line 1:
    ORA-14155: missing PARTITION or SUBPARTITION keywordSQL> select * from v$version
      2  ;BANNER
    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
    PL/SQL Release 9.0.1.1.1 - Production
    CORE    9.0.1.1.1       Production
    TNS for 32-bit Windows: Version 9.0.1.1.0 - Production
    NLSRTL Version 9.0.1.1.1 - Production
      

  3.   

    在我的9.2.0.1.0版本中
    alter table 表名  rename column  旧的属性名  to  新的属性名;
    是可以正确执行的!
      

  4.   

    我发现csdn里的人问题都不说明版本号!