你可以先算出来 表a.字段2-表b.字段3,放到一个变量里,在update 表a set 表a.字段2=变量 where 表a.字段1=表b.字段1

解决方案 »

  1.   

    你写错了。
    update 表a,表b set 表a.字段2=表a.字段2-表b.字段3 where 表a.字段1=表b.字段1
    没有表b你的数据源不就没有了吗?
      

  2.   

    update 表a set 表a.字段2=表a.字段2-表b.字段3 from 表a,表b where 表a.字段1=表b.字段1
      

  3.   

    wangxd1976的回答我试过了,同样错了
      

  4.   

    update 表a set 表a.字段2= 
      (Select 表a.字段2 - 表b.字段3 
       from 表a, 表b 
       where 表a.字段1=表b.字段1)试一下
      

  5.   

    弄错了一点,应该为:
    update 表a set 表a.字段2= 
      (Select 表a.字段2 - 表b.字段3 
      from 表b 
      where 表a.字段1=表b.字段1)