在數據庫原表中增加字段


假設你的表為  table1

字段列表為:
a varchar2(5)
b char2(10)
c number(2)

如果你想把表變成
a varchar2(5)
new_d varchar2(100)
b char2(10)
c number(2)


那么你需要:

1、這樣創建一個表:
create table table2  as select a,'NULL' as new_d,b,c from table1;

2、這樣修正這個表:
alter table table2 modify (new_d varchar2(20))

3、刪掉原來的表:

drop table table1;

4、修改當前的表名:

rename table2 to table1;


免責聲明!

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



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