Oracle method to modify the field name: use the "alter table" statement with the rename keyword to modify the field name. The syntax is "alter table table name rename column old field name to new field name;".
Recommended tutorial: "Oracle Tutorial"
oracle Modify Field Name
Use the "alter table" statement with the rename keyword to modify the field name. Syntax:
alter table 表名 rename column 旧的字段名 to 新的字段名;
ALTER TABLE
statement is used in Add, delete or modify columns in existing tables.
The rename keyword can be used to modify table names and field names
Let’s give an example:
Create the following table
CREATE TABLE Student( id varchar2(32) primary key, name varchar2(8) not null, age number );
There is a field named "name". Now if you want to change the "name" field name to "StuName", you can use the following statement
to modify the field name:
alter table Student rename column name to StuName;
Extended information
1. Modify the table name
Syntax
alter table 表名 rename to 新表名
2. Modify the field data type
Grammar:
alter table tableName modify (cloumnName 数据类型);
Related recommendations: php training
The above is the detailed content of How to modify field name in oracle?. For more information, please follow other related articles on the PHP Chinese website!