pg执行update select时报错
ERROR: column "a" of relation "table2" does not exist
UPDATE table1 a SET a.order_no =b.order_no from table2 b WHERE b.serial_no = a.order_no
set不能使用别名,即使定义了别名也不生效
UPDATE table1 a SET order_no =b.order_no from table2 b WHERE b.serial_no = a.order_no;
update 待更新表 a
set 待更新表_字段一 = b.字段一
from 关联表 b
where a.关联字段= b.关联字段
;
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有