Oracle database development SQL base data in the operations table

Source: Internet
Author: User

One, add data

INSERT statement INSERT INTO TABLE_NAME (Name of field, field name) VALUES (value1,value2)

1. Add values to all fields in the table

INSERT into UserInfo

VALUES (1, ' xxx ', ' 123 ', ' [email protected] ', sysdate)

2. Add values to the fields established in the table

INSERT into UserInfo (ID,USERNAME,USERPWD)

VALUES (2, ' yyy ', ' 123 ')

CREATE TABLE Userinfo1

(ID number (6,0),

RegDate Date Default Sysdate

)

INSERT into USERINFO1 (ID)

VALUES (1)

Second, copy the table data

1. Copy all when creating a table

CREATE TABLE userinfo_new

As

Select*from UserInfo

2. Select copy when creating a table

CREATE TABLE Userinfo_new1

As

Select Id,username from UserInfo

3. Add extra overtime to copy all

INSERT into Userinfo_new

Select*from UserInfo

4. Select Copy

INSERT into Userinfo_new (id,username)

Select Id,username from UserInfo

Third, modify the data

1. Unconditional Updates

UPDATE UserInfo

SET userpwd= ' 111 '

UPDATE UserInfo

SET userpwd= ' 1 ', email= ' [email protected] '

2. Conditional updates

UPDATE UserInfo

Set userpwd= ' 123 '

where username= ' xxx '

3. Unconditional deletion

CREATE TABLE TESTD1

As

Select*from UserInfo

DELETE from TESTD1

4. Conditional removal

Delete from UserInfo

where Username= ' yyy '

Oracle database development SQL base data in the operations table

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.