In Oracle, you can use the rename keyword to modify the field name; the syntax is "alter table table name rename column old field name to new field name;".
oracle modifies the field name
Use the rename
keyword To modify the field name, the syntax is:
alter table 表名 rename column 旧的字段名 to 新的字段名;
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 are 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: Modify field data type
Syntax:
alter table tableName modify (cloumnName 数据类型); -- 修改数据类型
Example: Still the above example
Modify data type :
alter table Student modify (id varchar2(64));
Recommended tutorial: "Oracle Tutorial"
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!