oracle 一次刪除,增加,修改多個字段

案例說明:

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                        

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章