SQl UPDATE 多表关联问题

UPDATE ta SET Name='alovejun' FROM T_User AS ta
 INNER JOIN T_AreaSet AS  tb ON tb.AreaId=ta.AreaId
WHERE tb.AreaId LIKE '%4312%'

实例:
UPDATE tb SET tb.CurrentAge=((tb.CurrentYear*12+tb.CurrentMonth)-(Year(ta.Birthday)*12+MONTH(ta.Birthday)))/12 FROM T_Person AS ta 
INNER JOIN T_ChangeCases AS tb ON ta.PersonId=tb.PersonId

 

你可能感兴趣的:(update)