Home  >  Article  >  Database  >  How to write the statement to modify the field name in Oracle

How to write the statement to modify the field name in Oracle

王林
王林Original
2020-06-17 10:46:333658browse

How to write the statement to modify the field name in Oracle

Statement:

alter table tableName rename column oldCName to newCName; -- 修改字段名

Example:

For example, we create a table now:

CREATE TABLE Student(
    id varchar2(32) primary key,
    name varchar2(8) not null,
    age number
  );

Now, we want to modify How to implement the field names of this table?

The statement is as follows:

alter table Student rename name to StuName;

What if you want to modify the data type of the field?

alter table Student modify (id varchar2(64));

Recommended tutorial: oracle tutorial

The above is the detailed content of How to write the statement to modify the field name in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn