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

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.

主站蜘蛛池模板: 上蔡县| 东源县| 英吉沙县| 深泽县| 新化县| 吉安县| 宁津县| 新乡县| 宁夏| 和田市| 洪雅县| 上饶市| 噶尔县| 澜沧| 华蓥市| 民权县| 寻甸| 林州市| 美姑县| 杭锦后旗| 沧源| 宜昌市| 吉安县| 汕头市| 普兰县| 咸阳市| 米泉市| 辉南县| 田东县| 垣曲县| 武强县| 务川| 宜兰市| 香河县| 息烽县| 荔浦县| 扎囊县| 山东省| 黄石市| 台江县| 潞西市|