update 表{1}
   set 表{1}.dj = (select sum(dj) from 表{2} group by bh)
   where 表{1}.bh = 表{2}.bh

解决方案 »

  1.   

    select 表(1).bh,表(1).sl,sum(dj) from 表(1),表(2) where 表(1).bh = 表(2).bh group by bh,sl
      

  2.   

    update 表1 set dj=(select sum(表2.dj) from 表2 where 表2.hh=表1.hh)
      

  3.   

    select table1.bh, table1.s1, (select isnull(sum(table2.dj),0) from table2 where table2.bh=table1.bh) as dj from table1
      

  4.   

    要判断空么?update table1 set table1.dj = (select isnull(sum(table2.dj), 0) from table2 where table2.bh = table1.bh)
      

  5.   

    update table1 set table1.dj = (select sum(dj) from table2 group by bh) where table1.bh = table2.bh