oracle如何修改表字段名


本文摘自PHP中文网,作者hzc,侵删。

oracle修改表字段名的方法是:

首先bai方法是使用RENAME关键字:

修改字段名:

1

alter table 表名 rename column 现列zhi名 to 新列名;

修改表名:

1

alter table 表名 rename to 新表dao名

增加字段语法:

1

alter table tablename add (column datatype [default value][null/not null],….);

说明:

1

alter table 表名 add (字段名 字段类型 默认值 是否为空);

例:

1

alter table sf_users add (HeadPIC blob);

例:

1

alter table sf_users add (userName varchar2(30) default '空' not null);

修改字段的语法:

1

alter table tablename modify (column datatype [default value][null/not null],….);

说明:

1

alter table 表名 modify (字段名 字段类型 默认值 是否为空);

例:

1

alter table sf_InvoiceApply modify (BILLCODE number(4));

删除字段的语法:

1

alter table tablename drop (column);

说明:

1

alter table 表名 drop column 字段名;

例:

1

alter table sf_users drop column HeadPIC;

字段的重命名:

阅读剩余部分

相关阅读 >>

如何保持oracle数据库的优良性能

order是什么意思?

oracle undo解析

oracle递归查询connectby用法

sql – oracle中匿名tablevarray类型示例详解

oracle转小写函数是什么

oracle锁机制深入理解

oracle securefile的功能第14页

oracle执行cmd的实现方法

sqlplus 命令登录 oracle数据库的多种方法

更多相关阅读请进入《oracle》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...