现在的位置: 首页 > 综合 > 正文

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

2014年11月08日 ⁄ 综合 ⁄ 共 816字 ⁄ 字号 评论关闭

案例说明:

SQL> create table t(a number);
 
Table created
 
SQL> desc t;
Name Type   Nullable Default Comments
---- ------ -------- ------- --------
A    NUMBER Y                        
 
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                        

抱歉!评论已关闭.