有两张表 A,B
A中有年份NF,部门号BMH,工资GZ
B中有年份NF,部门号BMH,平均工资PJGZ
现在要UPDATE A表,根据B表初始化A表,要求A的更新是根据B的年份,部门号一致?
大家帮忙!

解决方案 »

  1.   


    update a
    set gz=pjgz
    from a,b
    where a.nf=b.nf and a.bmh=b.bmh
    ??
      

  2.   

    update a set gz=b.pjgz
    from a , B where a.nf=b.nf and a.bmh=b.bmh
      

  3.   


    update A set A.gz=B.pjgz
    from A,B
    where A.BMH=B.BMH AND A.NF=B.NF
      

  4.   

    update A set 工资GZ = 平均工资PJGZ from A,B where A.NF=B.NF And A.BMH=B.BMH 
      

  5.   

    update A set a.gz=b.pjgz from a,b where a.nf=b.nf and a.bmh=b.bmh
      

  6.   

    那么有gz工资,福利fl。
    且都是nf2010年怎么写?
      

  7.   


    update a
    set gz=pjgz,
    fl=pjfl
    from a,b
    where a.nf=b.nf and a.bmh=b.bmh
      

  8.   


    update A set A.gz=B.pjgz,A.FL=B.FL
    from A,B
    where A.BMH=B.BMH AND A.NF='2010'
      

  9.   

    update A set a.gz=b.pjgz from a,b where a.nf=b.nf and a.bmh=b.bmh