示例:
UPDATE prj_odn_fibersegment f set f_aid=f2.f_aid , f_zid=f2.f_zid ,
f_style=(f.f_style::jsonb||concat('{"a_id":"',f2.f_aid,'","z_id":"',f2.f_zid,'"}')::jsonb)
FROM prj_topo_fibersegment f2
WHERE f.f_id=f2.f_id
and f2.f_aid is not null and f2.f_zid is not null and f.f_aid is null and f.f_zid is null
注意:
set后的更新属性不能带表别名,否则报错