Oracle's column operations (adding columns, modifying columns, deleting columns), including manipulating multiple columns

Source: Internet
Author: User

Add a column:

ALTER TABLE Emp4 Add test varchar2 (10);

To modify a column:

ALTER TABLE Emp4 Modify Test varchar2 (20);

Delete a column:

ALTER TABLE emp4 drop column test;

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.

Add multiple columns:

ALTER TABLE Emp4 Add (Test varchar2 (Ten), test2 number);

Modify multiple columns:

ALTER TABLE Emp4 Modify (test varchar2, Test2 varchar2 (20));

To delete multiple columns:

ALTER TABLE Emp4 drop (TEST,TEST2);

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

Oracle's column operations (adding columns, modifying columns, deleting columns), including manipulating multiple 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.