官术网_书友最值得收藏!

Using the UPDATE operation clauses

The PostgreSQL UPDATE query is used to modify the existing records in a table. You can use the WHERE clause with the UPDATE query to update selected rows; otherwise, all the rows will be updated.

The basic syntax of the UPDATE query with the WHERE clause is as follows:

UPDATE table_name
SET column1 = value1, column2 = value2...., columnN = valueN
WHERE [condition];

You can combine n number of conditions using the AND or OR operators.

The following is an example that will update SALARY for an employee whose ID is 6:

UPDATE employee SET SALARY = 15000 WHERE ID = 6; 

This will update the salary to 15000 whose ID = 6.

主站蜘蛛池模板: 新源县| 江山市| 松潘县| 新津县| 宁安市| 靖宇县| 舟山市| 河北省| 青龙| 许昌市| 烟台市| 温宿县| 长丰县| 南丹县| 项城市| 勐海县| 象山县| 濮阳市| 弋阳县| 濮阳县| 凤城市| 卢湾区| 资阳市| 开鲁县| 河池市| 静宁县| 焉耆| 江阴市| 华蓥市| 穆棱市| 阿瓦提县| 巴塘县| 聊城市| 邯郸县| 西盟| 周至县| 灵山县| 英德市| 山丹县| 霍州市| 河源市|