update 表2 set pass=b.count from 表2 a,表1 b where 表2.name=表1.name

解决方案 »

  1.   

    update 
        a
    set 
        pass = b.count
    from
        表2 a,
        表1 b
    where
        a.name=b.name
      

  2.   

    update 表2
    set pass=isnull(B.count,0)
    from 表2 A
    left join 表1 B on A.name=B.name
      

  3.   

    如果是相加:
    -----------------------------------
    update 
        a
    set 
        pass = isnull(pass,0) + b.count
    from
        表2 a,
        表1 b
    where
        a.name=b.name