日期:2014-05-16  浏览次数:20493 次

oracle 一次删除,增加,修改多个字段

创建表:

SQL> create table t(a number);
?
Table created
?
SQL> desc t;
Name Type?? Nullable Default Comments
---- ------ -------- ------- --------
增加多个字段 ??????????????????????
?
SQL> alter table t add (b number,c number);
?
Table altered
?
SQL> desc t;
Name Type?? Nullable Default Comments
---- ------ -------- ------- --------

修改多个字段


A??? NUMBER Y????????????????????????
B??? NUMBER Y????????????????????????
C??? NUMBER Y????????????????????????
?
SQL> alter table t modify (b varchar2(10),c varchar2(10));
?
Table altered
?
SQL> desc t;
Name Type???????? Nullable Default Comments
---- ------------ -------- ------- --------

删除表
A??? NUMBER?????? Y????????????????????????
B??? VARCHAR2(10) Y????????????????????????
C??? VARCHAR2(10) Y????????????????????????
?
SQL> alter table t drop (b,c);
?
Table altered
?
SQL> desc t;
Name Type?? Nullable Default Comments
---- ------ -------- ------- --------
A??? NUMBER Y?????????