Orcal数据库 表修改

来源:互联网 发布:办公软件站长网站 编辑:程序博客网 时间:2024/06/05 19:52

表字段修改

修改表字段默认值

alter table 表名 modify 字段名 default 默认值;

alter table tablename modify create_time default sysdate;

给字段添加注释说明

comment on column 表名.字段名 is ‘注释内容’;

comment on column T_STUDENT.NAME  is '学生名';

修改字段数据类型(长度)

alter table 表名 modify 字段名 数据类型;

alter table T_STUDENT modify  name varchar2(20);

从一张表复制表结构到新表

create table newtable as select * from oldtable where 1=2

从一张表复制表结构到新表(包括数据)

create table newtable as select * from oldtable

原创粉丝点击