oracle 表字段新增、修改、刪除、重命名以及表重命名


增加字段語法:alter table 表名 add (字段名 字段類型 默認值 是否為空);

例:

alter table student add(score number(3,1) default 0 not null);

修改字段的語法:alter table 表名 modify (字段名 字段類型 默認值 是否為空);

例:

 

alter table student modify(score number(3,2));

 

刪除字段語法:alter table 表名 drop column 字段名;

例:

 

alter table student drop column score;

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

例:

 

alter table student rename column score to score1;

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

例:

alter table student rename to student1;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM