db2 update方法

1、符合修改,不合符为空
update tg_ca_bank a 
set a.s_linename=(select s_parametervalue from tg_ca_comm b where a.s_linecode=b.s_parametercode) 
2、符合修改,不符合不修改
update tg_ca_bank a 
set a.s_linename=(select s_parametervalue from tg_ca_comm b where a.s_linecode=b.s_parametercode) 
where a.s_linecode in (select b.s_parametercode from tg_ca_comm b where a.s_linecode=b.s_parametercode)

猜你喜欢

转载自blog.csdn.net/m0_37604866/article/details/83755408