当前位置:数据库 > Oracle >>

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

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         
 
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,