增加列:alter table 表名 add(列名 数据类型);
修改列:alter table 表名 modify(列名 新的数据类型);
删除列:alter table 表名 drop column 列名;

解决方案 »

  1.   

    alter table 表名 add 项名 类型;增加一项
    alter table 表名 change 旧项名 新项名;更改表中某一项的名
    alter table 表名 modify 项名 类型;更改表中某一项的类型
      

  2.   

    我执行了这个语句   alter table nametable drop column s    提示我缺少关键字为什么阿
      s 为表 nametable 里的一个字段
      

  3.   

    看一下oracle8.16的管理员手册吧,里面有详细的说明,当删除一个字段时,应该在column后还有一个关键字,具体什么忘了,你查书吧.
      

  4.   

    CREATE TABLE t1 (
       pk NUMBER PRIMARY KEY,
       fk NUMBER,
       c1 NUMBER,
       c2 NUMBER,
       CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,
       CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0),
       CONSTRAINT ck2 CHECK (c2 > 0)
    );
    An error will be returned for the following statements:/* The next two statements return errors:
    ALTER TABLE t1 DROP (pk); -- pk is a parent key
    ALTER TABLE t1 DROP (c1);  -- c1 is referenced by multicolumn
                               -- constraint ck1
    Submitting the following statement drops column pk, the primary key constraint, the foreign key constraint, ri, and the check constraint, ck1:ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS;
    If all columns referenced by the constraints defined on the dropped columns are also dropped, then CASCADE CONSTRAINTS is not required. For example, assuming that no other referential constraints from other tables refer to column pk, then it is valid to submit the following statement without the CASCADE CONSTRAINTS clause:ALTER TABLE t1 DROP (pk, fk, c1);