Oracle表,字段,列操作

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 

猜你喜欢

转载自blog.csdn.net/javaFay/article/details/8054947
今日推荐