>  기사  >  데이터 베이스  >  修改表结构的写法

修改表结构的写法

WBOY
WBOY원래의
2016-06-07 15:22:431044검색

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 st

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;
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.