ORACLE—001:Alter之增加字段,修改字段类型
时间:2014-06-05 10:17:14
收藏:0
阅读:340
——积累工作中用到的SQL
1、增加和删除一列
写法:
--增加一列
alter table 表名 add 列名 类型;
--删除一列
alter table 表名 drop column 列名 ;
例如:
--增加一列
alter table TB_TEMP add COL_ID VARCHAR2(40);
--删除一列
alter table TB_TEMP drop column COL_ID ;
2、修改列的类型(以修改varchar2的长度为例)
例如:ALTER 表名 MODIFY 列名 varchar2(100);
评论(0)