postgresql - 如何使用 golang 和 prepare 更新 postgres 中的多行?
问题描述
我想在 golang 中做这样的事情
update test as t set
column_a = c.column_a,
column_c = c.column_c
from (values
('123', 1, '---'),
('345', 2, '+++')
) as c(column_b, column_a, column_c)
where c.column_b = t.column_b;
我在一次往返中更新多行
stmt.Exec(vals...)
有没有办法像where那样做准备vals = []interface{}
解决方案
推荐阅读
- android - RecyclerView DiffUtil 需要手动更新数据吗?
- python - 如何在我的 PySide(Maya) 脚本中修复“非序列迭代”
- javascript - Express Router delete with mongoose 不适用于 ES8 语法
- json - 存储大量可查询的 JSON
- android - 如何使用渐变颜色为在bottomNavigationView中选择的图标着色
- javascript - JavaScript 中的@media 屏幕?
- visual-studio - Showing OutputDebugString messages with Window application?
- bash - 创建一个包含 bash 命令替换和参数的 git 别名
- angular - Template parse errors: There is no directive with "exportAs" set to "cdkDropList"
- sql-server - 在 SQL 中计算字符串中每个字母的出现次数