添加字段
语法:
alter table 表名 add (字段名 字段类型 默认值 是否为空);
示例:
alter table sf_users add (HeadPIC blob);
alter table sf_users add (userName varchar2(30) default '空' not null);
删除字段
语法:
alter table 表名 drop column 字段名;
示例:
alter table sf_users drop column HeadPIC;
修改字段
语法:
alter table 表名 modify (字段名 字段类型 默认值 是否为空);
示例:
alter table sf_InvoiceApply modify (BILLCODE number(4));
字段重命名
语法:
alter table 表名 rename column 列名 to 新列名
示例:
alter table sf_InvoiceApply rename column PIC to NEWPIC;
表重命名
语法:
alter table 表名 rename to 新表名
示例:
alter table sf_InvoiceApply rename to sf_New_InvoiceApply;
网友评论