PostgreSQL update set from 两表联合更新

update t_business tb
set system_id = ir.application_id
from t_business_irregular ir
where tb.affected_business = ir.application_name 

update t_business tb
set system_id = ir.application_id
from t_business_irregular ir
where tb.fault_system = ir.application_name 
update t_business_irregular bi set status = 0  from t_business_standard bs
        where bi.application_id = bs.application_id
                and bi.application_name = bs.application_name

你可能感兴趣的:(#,PostgreSQL,postgresql,数据库)