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

来源:互联网 发布:青岛app软件开发 编辑:程序博客网 时间:2024/04/29 07:13

案例说明:

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                        

原创粉丝点击