Oracle表,字段,列操作

2021-06-10 02:10:35 字數 768 閱讀 8843

1、新增字段 

alter table student add age number(5); 

2、修改字段 

alter table student modify age number(10); 

alter table table2 rename column result to result2; 

3、刪除字段 

alter table student drop column age; 

4、清空表中資料 

truncate table student;  

正常情況下刪除資料,如果發現刪除錯了,則可以通過 rollback 回滾。如果使用了截斷表,

則表示所有的資料不可恢復了.所以速度很快(更詳細的說明可檢視 oracle體系結構) 

5、刪除表 

drop table student; 

6、重新命名表 

rename student to student1; 

新增一列:  

alter table a add( cfyjsnr varchar2(20));  

修改列:  

alter table a rename column cfyjsnr to cfjysnr;   

修改列的型別:  

alter table a modify cfyj varchar(200);  

刪除資料庫一列  

alter table a drop column cfyjsnr 

Oracle操作表,字段

0.建立表 create table table name as select from table name b 1.oracle 修改表名 alter table old table name rename to new table name 大寫為系統命令 2.oracle通過altertab...

Oracle表字段操作,增 刪 改

alter table tablename add column datatype default value null not null alter table tablename modify column datatype default value null not null alter t...

oracle修改表字段

增加字段 alter table docdsp add dspcode char 200 刪除字段 alter table table name drop column column name 修改字段型別 alter table table name alter column column nam...