Home > Database > Oracle > How to delete a column in oracle

How to delete a column in oracle

WBOY
Release: 2022-01-21 14:48:16
Original
14034 people have browsed it

In Oracle, you can use the ALTER statement with "DROP COLUMN" to delete the specified column. The syntax is "ALTER TABLE table name DROP COLUMN column name" or "ALTER TABLE table name DROP (column name 1, column Name 2)".

How to delete a column in oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to delete a column in oracle

How to delete a column in oracle:

ALTER TABLE 表名 DROP COLUMN 列名
Copy after login

Delete multiple columns: (It’s strange that there is no need for column, all field names are Simple field name):

     alter table 表名  drop (字段1,字段2)
Copy after login

Extension:

Add column

alter table t_jm_user add USR_EmailValidate CHAR(1) default 'N' not null;
Copy after login

Modify column

alter table t_jm_user modify USR_EmailValidate CHAR(1) default 'Y'  null;
Copy after login

Delete column

alter table t_jm_user drop column  USR_EmailValidate;
Copy after login

Add constraint

alter table user
  add constraint FK_user_CLIENT foreign key (COMP_ID)
  references T_stal (COMP_ID);
Copy after login

Delete constraints

alter table user drop constraint FK_user_CLIENT ;
Copy after login

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to delete a column in oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template