Home > Database > Oracle > body text

How to delete column in oracle?

coldplay.xixi
Release: 2020-07-16 10:55:16
Original
13374 people have browsed it

How to delete a column in oracle: 1. Delete a column, the code is [ALTER TABLEtable_name DROP COLUMNcolumn_name;]; 2. Delete multiple columns, the code is [ALTER TABLE table_name DROP(column1,].

How to delete column in oracle?

Oracle method to delete a column:

1. Delete a column

ALTER TABLE table_name DROP COLUMN column_name;
Copy after login

2. Delete multiple columns

ALTER TABLE table_name DROP (column_1,column_2,...);
Copy after login

Extended information:

1.Add a column

ALTER TABLE table_name ADD column_1 DATE NOT NULL; 
ALTER TABLE table_name ADD column_2 VARCHAR2(44) DEFAULT ''; 
ALTER TABLE table_name ADD column_3 number(28,10);
Copy after login

2. Add a column

ALTER TABLE table_name
    ADD (
        column_1 type constraint,--列名 类型 约束
        column_2 type constraint,
        ...
    );
Copy after login

Related learning recommendations: oracle database learning tutorial

The above is the detailed content of How to delete 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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!