更新时间:2026-07-31 GMT+08:00
分享

UPDATE FROM

功能描述

将源表中某个字段的值更新到目标表的字段。

血缘解析支持的语法格式

UPDATE {schema_name}.{table_name1} SET col1 = b.col2 FROM {schema_name}.{table_name2} b

语句示例

UPDATE public.dws_table_2 target
SET 
    target.col1 = source.col1,
    target.col2 = source.col2,
    target.update_time = source.update_time
FROM public.dws_table_1 source
WHERE target.id = source.id;

相关文档