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

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.

主站蜘蛛池模板: 南木林县| 达日县| 秭归县| 嘉善县| 冀州市| 汕尾市| 长寿区| 炎陵县| 镇巴县| 拜城县| 洛扎县| 昭通市| 青海省| 霍林郭勒市| 清流县| 正镶白旗| 和政县| 洛宁县| 绥棱县| 阳高县| 涪陵区| 怀仁县| 安化县| 南阳市| 神池县| 铜陵市| 宁明县| 两当县| 漳浦县| 遂平县| 巴中市| 天津市| 株洲县| 晋宁县| 启东市| 肥城市| 巫山县| 独山县| 大方县| 新竹县| 石林|