Oracle column operations (add columns, modify columns, delete columns)

Source: Internet
Author: User

1. Add a column:

Alter table name add column name varchar2 (10);

2. Modify a column:

  Alter Table name modify column name varchar2 (20);

3. Delete a column:

  Alter table name drop column name ;

Here are a few places to note, first, add and modify the column is not required to add the keyword column, or will error ora-00905.

Second, to delete a single column, be sure to add column, and then remember that the deletion is not required to add the type.

4. Add multiple columns:

  Alter table name Add ( column name 1 varchar2 (Ten), column name 2 number);

5. Modify multiple columns:

  Alter Table name Modify ( column name 1 varchar2, column name 2 varchar2 (20));

6. Delete multiple columns:

  Alter table name drop ( column name 1, column name 2);

Strange phenomenon, in the column to add the keyword column, however, when you delete multiple columns, you cannot add the column keyword.

Oracle column operations (add columns, modify columns, delete columns)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.