数据库
首页 > 数据库> > MySQL联表更新

MySQL联表更新

作者:互联网

update A as phg left join B as pb on phg.patient_id = pb.patient_id 
set phg.double_flag = 
case
when pb.live_place_community  =  pb.census_register_community then 0  #否双列管
when pb.live_place_community != pb.census_register_community then 1  #是双列管
end

标签:when,phg,community,pb,live,更新,联表,MySQL,id
来源: https://blog.csdn.net/yzw3270978316/article/details/122360878