PostgreSQL之INSERT,DELETE,UPDATE

Insert data

Each column assignment, you can omit the column name

INSERT INTO Product VALUES(value1,value2,DEFAULT,value3,NULL)

Only part of the column assignment, we need to add the column name. Column names is omitted, if there is a default value is the default value if no default value is NULL. If there is neither a default value of another non-null constraint, the execution fails

INSERT INTO Product (column1,column2,column3) VALUES(value1,value2,value3)

delete data

Empty table without deleting the table

DELETE FROM 表名

Delete table

DROP TABLE 表名

Update table

UPDATE table SET column 1 = value1, column 2 = value2 WHERE ...

If no WHERE, then all rows of the specified column will be changed.

 

Guess you like

Origin www.cnblogs.com/zhenguan/p/11443009.html