Oracle修改表字段操作SQL
阿新 • • 發佈:2018-12-15
增加欄位: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;