update a set jj=case when sl=0 then b.dj else je/sl end 
from b where a.id=b.id  --id是两表关联字段

解决方案 »

  1.   

    update  A   set JJ=(case when sl=0  then B.Dj else  JE/SL end)  from A inner join B
    On A.關聯字段=B.關聯字段
      

  2.   

    虽然不关联,但这两个表都有共同的字段code。可以根据code 是否相等来检索。
      

  3.   

    update a set jj=case when sl=0 then b.dj else je/sl end 
    from b where a.code=b.code
      

  4.   

    update  A   set JJ=(case when sl=0  then B.Dj else  JE/SL end)  from A inner join B
    On A.Code=B.Code