- 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
.
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- UML和模式應用(原書第3版)
- Java 開發從入門到精通(第2版)
- 跟“龍哥”學C語言編程
- Vue.js 2 and Bootstrap 4 Web Development
- AngularJS Web Application Development Blueprints
- 區塊鏈架構與實現:Cosmos詳解
- EPLAN實戰設計
- Python Web數據分析可視化:基于Django框架的開發實戰
- Node.js Design Patterns
- R語言數據可視化:科技圖表繪制
- C++ Fundamentals
- Node.js區塊鏈開發
- H5匠人手冊:霸屏H5實戰解密
- Testing Practitioner Handbook