Oracle修改表结构的基本sql语句

--修改字段名称
alter table 表名 rename column 现在的字段名 to 新字段名;

--修改表名
alter table 表名 rename to 新表名;

--修改字段数据类型
alter table 表名 modify 字段名 新数据类型(长度);

--在表中新增字段
alter table 表名 add 新字段名 新数据类型(长度) [约束,例如:not null] comment 'comment是添加字段描述,可加可不加';

--直接给表添加表描述
comment on table 表名 is '此处是表描述';

--直接给表中的字段添加字段描述
comment on table 表名.字段名 is '此处是字段描述,注意表名和字段名中间的点';

--删除表字段
alter table 表名 drop column 字段名;

你可能感兴趣的:(Oracle修改表结构的基本sql语句)