您的位置:首页 > 数据库 > Oracle

Oracle中常用的修改表操作的sql语句

2012-03-19 14:25 387 查看
drop table test2;

create table test(

id integer not null,

name varchar2(100)

);

---可为空

alter table test modify (id null);

---不可为空

alter table test modify (id not null);

---添加表中的列 alter table + add子句

alter table test add (ceilphone varchar2(20));

---修改表中的列 alter table + modify子句,如果是不可为空,要先update,再修改

alter table test modify (ceilphone integer);

----删除列

alter table test drop column ceilphone;

---重命名表

alter table test rename to test2;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: