简体   繁体   English

用 postgreSQL 更新每一行中的特定列

[英]Update specific column in every row with postgreSQL

I have a table available_trucks.我有一张桌子可用的卡车。 I need to update available_date column in every row.我需要更新每一行中的 available_date 列。 I am very new to the DB world.so i don't know how to do that.我对数据库世界很陌生。所以我不知道该怎么做。 I used previous knexjs as sql builder with db in pg admin, because i have little knowledge of sql, but there i can't solve my problem with knexjs, i can't update every row.我使用以前的 knexjs 作为 sql builder 和 pg admin 中的 db,因为我对 sql 知之甚少,但是我无法用 knexjs 解决我的问题,我无法更新每一行。

I posted this question我发布了这个问题

How can i update every row in my table using knex.js? 如何使用 knex.js 更新表中的每一行?

but nobody helped me and i searched throug google but no success.但没有人帮助我,我通过谷歌搜索但没有成功。 Now at the end i must solve this somehow with pure postgreSql.现在最后我必须用纯 postgreSql 以某种方式解决这个问题。

UPDATE available_trucks SET available_date = '22.12.2020';

This updates the available_date to 22.12.2020 (for example) in the table available_trucks for EVERY entry in the table (if this is what you want to do).这会将表 available_trucks 中每个条目的 available_date 更新为 22.12.2020(例如)(如果这是您想要执行的操作)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM