原文:https://blog.csdn.net/DaneLei/article/details/87986131
修改字段名语法:alter table tableName rename column oldCName to newCName;
例:alter table student rename column address to addr
添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….);
例:alter table student add( grade number(3) default 99 not null) ;
修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….);
例:alter table student modify(grade varchar2(5));
删除字段的语法:alter table tablename drop (column);
例:alter table student drop (grade);
/*修改原字段名grade为grade_tmp*/
alter table student rename column grade to grade_tmp;
/*增加一个和原字段名同名的字段grade*/
alter table student add grade number(3);
/*将原字段grade_tmp数据更新到增加的字段grade*/
update student set grade=trim(grade_tmp);
/*更新完,删除原字段grade_tmp*/
alter table student drop column grade_tmp;