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