怎么又出来个表3?
是不是如下:
 update a set a.qty1 = a.qty1 + b.qty2 
     from 表1 a
     join 表2 b on a.idno = b.goodsid

解决方案 »

  1.   

    update 表1 set qty1=表2.qty2 from 表2 where 表1.idno=表2.goodsid
      

  2.   

    update 表1 set qty1=表1.qty1+表2.qty2 from 表2 where 表1.idno=表2.goodsid
      

  3.   

    update 表1 set qty1=表1.qty1+表2.qty2 
    from   表1,表2 
    where  表1.idno=表2.goodsid
      

  4.   

    update 表1 set qty1=qty1+(select qty2 from 表2 a where a.goodsid=idno) where idno in (select b.idno from 表1 b,表2 c where b.idno=c.goodsid)
      

  5.   

    update 表1 set qty1=表1.qty1+表2.qty2 from 表2 where 表1.idno=表2.goodsid
      

  6.   

    update 表1 set qty1=表1.qty1+表2.qty2 from 表2 where 表1.idno=表2.goodsid
      

  7.   

    update 表1 set qty1=表2.qty2 from 表2 where 表1.idno=表2.goodsid
      

  8.   

    update 表1 set qty1=表1.qty1+表2.qty2 
    from 表1 inner join 表2 on 表1.idno=表2.goodsid 
    where 表1.idno=表2.goodsid
      

  9.   

    update 表1 set 数量=b.数量
    from 表1 a inner join(select 物料号,数量=sum(数量) from 表2 group by 物料号) b on a.货品号=b.物料号
      

  10.   

    update 表1 set 数量=a.数量+b.数量
    from 表1 a inner join(select 物料号,数量=sum(数量) from 表2 group by 物料号) b on a.货品号=b.物料号
      

  11.   

    create table table3(a varchar(20),b int);
    create table table4(c varchar(20),d int);
    insert into table3 values('a',1);
    insert into table3 values('b',10);
    insert into table3 values('c',15);
    insert into table3 values('d',80);
    insert into table3 values('h',90);insert into table4 values('a',100);
    insert into table4 values('c',150);
    insert into table4 values('a1',10);
    insert into table4 values('a2',10);
    insert into table4 values('a',50);
    insert into table4 values('a',50);
    insert into table4 values('h',50);
    insert into table4 values('h',50);update table3 set b=ISNULL((select sum(d) from table4 where table4.c=table3.a),0)+b;
      

  12.   

    请帮我解决这个问题:
    http://expert.csdn.net/Expert/topic/2168/2168349.xml?temp=.9867517