Oracle to the field of additions and deletions to change the method of sharing _oracle

Source: Internet
Author: User

Oracle is one of the most popular databases, powerful, excellent performance, relative to the difficulty of learning is not small. This article is to share some of their experience to everyone, to do a accumulation, to facilitate their own and other learners.

To modify a field type or length:

ALTER TABLE name modify field name segment type (character length)

Cases:

ALTER TABLE table_name MODIFY COLUMN_NAME varchar (10);

This is standard SQL and applies to any database

To modify a field name:

ALTER TABLE name rename column Old field name to new field name

Cases:

ALTER TABLE table_name Rename column old_column to New_column;

Add fields:

ALTER TABLE name Add (field name segment type and length)

ALTER TABLE table_name Add (one_column VARCHAR2 (10));

If you add more than one field at a time, each field is directly separated.

The following example:

ALTER TABLE table_name Add (One_column varchar2), Two_column varchar2 (5),....)

To delete a field:

ALTER TABLE name drop (field name)

ALTER TABLE table_name drop (one_column); or ALTER TABLE table_name drop column
one_column;

Delete multiple fields at once, separated by each field in parentheses.

The following example:

ALTER TABLE table_name DROP (One_column,two_column,...)

Summarize

The above is for you to sum up the Oracle to the field additions and deletions to change the entire contents of the statement, I hope that we can help. If you have questions or questions, you can leave a message.

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.