- PostgreSQL Development Essentials
- Manpreet Kaur Baji Shaik
- 120字
- 2021-07-14 10:00:55
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
.
推薦閱讀
- Google Apps Script for Beginners
- LabVIEW程序設計基礎與應用
- Web Development with Django Cookbook
- Java游戲服務器架構實戰
- Java性能權威指南(第2版)
- Java 9模塊化開發:核心原則與實踐
- R Data Analysis Cookbook(Second Edition)
- Windows內核編程
- Raspberry Pi Home Automation with Arduino(Second Edition)
- JavaScript腳本特效編程給力起飛
- 交互設計師成長手冊:從零開始學交互
- Monitoring Docker
- C++服務器開發精髓
- Distributed Computing with Python
- Scala編程(第4版)