增加列:alter table 表名 add(列名 数据类型);
修改列:alter table 表名 modify(列名 新的数据类型);
删除列:alter table 表名 drop column 列名;
修改列:alter table 表名 modify(列名 新的数据类型);
删除列:alter table 表名 drop column 列名;
解决方案 »
- 菜鸟:在VC中如何获得符合条件的记录数
- oracle 10.2.1 64位 windows server 2003 64位操作系统的问题
- 如何利用oracle的数据字典,查询某用户创建的全部表,但是不需要系统创建的表
- 复制问题
- 更改数据库的参数问题~~
- 请教一个关于时间的分组sql问题
- Oracle中,无法删除数据库吗?
- 【ORACLE外连接】 …… 不头晕得,近来给俺讲讲 ^8^
- 查询执行过的sql
- 大力,登山者,还好吗,一个关于表关联的问题
- 一个触发器问题,高分求解
- 用网络蚂蚁在ORACLR的网站下载,下载前两个没问题,为什么下载第三个总提示SetEndOfFile(112)的错误,然后下载中断?
alter table 表名 change 旧项名 新项名;更改表中某一项的名
alter table 表名 modify 项名 类型;更改表中某一项的类型
s 为表 nametable 里的一个字段
pk NUMBER PRIMARY KEY,
fk NUMBER,
c1 NUMBER,
c2 NUMBER,
CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,
CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0),
CONSTRAINT ck2 CHECK (c2 > 0)
);
An error will be returned for the following statements:/* The next two statements return errors:
ALTER TABLE t1 DROP (pk); -- pk is a parent key
ALTER TABLE t1 DROP (c1); -- c1 is referenced by multicolumn
-- constraint ck1
Submitting the following statement drops column pk, the primary key constraint, the foreign key constraint, ri, and the check constraint, ck1:ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS;
If all columns referenced by the constraints defined on the dropped columns are also dropped, then CASCADE CONSTRAINTS is not required. For example, assuming that no other referential constraints from other tables refer to column pk, then it is valid to submit the following statement without the CASCADE CONSTRAINTS clause:ALTER TABLE t1 DROP (pk, fk, c1);