update target set tFunds=(select tFunds+Source.sFounds from Source);

解决方案 »

  1.   

    update target set tFunds=tFunds+sFunds where target.tBillNo=source.sBillNo
      

  2.   

    这样吧update target set tFunds=(select tFunds+Source.sFounds from Source where target.tBillNo=source.sBillNo);
      

  3.   

    以上语句不行的,它将表target中匹配不上的行也都更改了:
    '000',Null
    '001',12
    '002',Null
    '003',Null
    '004',15
      

  4.   

    :)
    update target set tFunds=(select tFunds+Source.sFounds from Source ) where target.tBillNo=source.sBillNo;
      

  5.   

    you should better test your code first!!