ORACLE 表字段的修改和新增(11g)

2021-08-15 12:06:04 字數 630 閱讀 4390

表新增字段

alter table enmo add 

( archive      varchar(10),

time         date

)修改欄位為非空忽略表中原有資料

alter table scott.enmo modify name not null enable novalidate;

修改欄位名

alter table enmo rename column mingzi to name;

修改字段型別

alter table enmo modify name varchar2(100) ;

修改字段預設值

alter table enmo add column_1 varchar2(2) de****t 'y';

字段新增備註

comment on column scott.enmo.name is '名字';

刪除表中某個欄位的所有值

update enmo set name = null ;

給字段設定預設值

alter table test add name varchar2(10) default 'testcolumn' not null;

oracle修改表字段

增加字段 alter table docdsp add dspcode char 200 刪除字段 alter table table name drop column column name 修改字段型別 alter table table name alter column column nam...

Oracle 刪除新增表字段

原文 1.新增字段 alter table 表名 add 字段 字段型別 default 輸入預設值 null not null 2.新增備註 comment on column 庫名.表名.欄位名 is 輸入的備註 如 我要在ers data庫中 test表 document type欄位新增備註...

oracle表字段的增加刪除和修改

oracle表字段的增加刪除和修改 增加字段 alter table luffy.student test2 add cdr content varchar2 2000 alter table luffy.student test2 add course inst id number 12 alte...