您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 东营分类信息网,免费分类信息发布

oracle修改表名的语句是什么

2024/3/1 5:26:12发布21次查看
oracle修改表名的语句:1、“alter table 旧表名 rename to 新表名”,该语句利用alter在原表上修改表名;2、“rename 旧表名 to 新表名;”,该语句利用rename修改表名。
本教程操作环境:windows10系统、oracle 11g版、dell g3电脑。
oracle修改表名的语句是什么方法1:利用alter修改表名
alter table old_table_name rename to new_table_name;
方法2:利用rename修改表名
rename old_table_name to new_table_name;
扩展知识:
使用老表数据创建新表,再干掉老表(不推荐)
create new_table as select * from old_table;drop table old_table;
注意:表数据量大的话拉表很耽误时间,干掉老表也有可能影响某些正式运行的需要调用老表的job,有风险!
直接plsql 使用重建表(不推荐)
注意:重建表功能相当于 清掉所有数据 ,触发器,外键都会被清空,速度会很慢 ,效率并不是很好。
修改列的名称
修改表中的列的名称的语法如下:
alter table table_name rename column column_name to new_column_name;
如,将person表中的birthday列的名称修改为age,如下:
sql> alter table person rename column birthday to age;
推荐教程:《oracle视频教程》
以上就是oracle修改表名的语句是什么的详细内容。
东营分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录