1、安装dblink

2、将一个表的字段更新至另一张表

UPDATE public.information
set public.information.creator_id=admaf.id
from
(
SELECT * FROM dblink('hostaddr=1127.0.0.1 port=54321 dbname=ad user=sys password=12345',
'select account,id from od_user')AS base(account text,id text)
) admaf
where public.information.creator_name=admaf.account

posted on 2022-07-03 20:21  田坤坤  阅读(307)  评论(0编辑  收藏  举报