sqlserver left join 左连接更新

sqlserver left join 左连接更新

--左连接查询
select bus.BusinessCode,bus.AcceptanceId,bus.BusAcceptanceTime
,acc.AcceptanceId,acc.AcceptanceTime 
from TBusiness bus
left join TAcceptanceForm acc on bus.AcceptanceId=acc.AcceptanceId
where BusinessCode in ('BS000000001','BS000000002','BS000000003');

--左连接更新
update TBusiness  set BusAcceptanceTime=acc.AcceptanceTime
from TBusiness bus
left join TAcceptanceForm acc on bus.AcceptanceId=acc.AcceptanceId
where BusinessCode in ('BS000000001','BS000000002','BS000000003');

 

posted on 2022-08-10 11:05  Jankie1122  阅读(289)  评论(0编辑  收藏  举报