Oracle修改表字段操作SQL

增加字段:alter table 表名 add (字段名 字段类型 默认值 是否为空);

alter table tablename add (column datatype [default value][null/not null],….);

修改字段:alter table 表名 modify (字段名 字段类型 默认值 是否为空);

alter table tablename modify (column datatype [default value][null/not null],….);

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

alter table tablename drop (column);

重命名字段:alter table 表名 rename  column  列名 to 新列名;

alter table tablename rename column oldColumn to newColumn;

重命名表名:alter table 表名 rename to  新表名;

alter table tablename rename to newTableName;

猜你喜欢

转载自blog.csdn.net/NGRsjdn/article/details/83062853