Psql 学习经验记录 之批量更新
UPDATE
iot_base.iot_space as tabl1 set "name"= tabl2."name"
FROM (select "id",split_part("name",'_',2) as "name" from iot_base.iot_space where building_id='29' and "level" =1 and "name" like '电_%' ) as tabl2
WHERE tabl1."id" = tabl2."id";
sql 解析
update 更新的表 set 更新列 = 来自哪张表的哪个字段 from 来自哪张表 where 关联条件