表1
单位名称  盒数1 金额1表2
单位名称  收入数量 收入金额用表2中的收入数量替换表1中的盒数1 ,收入金额替换表1中的金额1 

解决方案 »

  1.   

    update test1 set hs=test2.srsl,je=test2.srje from test1,test2 where test1.dwmc=test2.dwmc测试成功
      

  2.   

    ADOQuery1.Close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Add('UPDATE temp SET 盒数1=temp2.收入数量,金额1=temp2.收入金额');
    ADOQuery1.SQL.Add(FROM temp,temp2);
    ADOQuery1.SQL.Add(WHERE temp.单位名称=temp2.单位名称);
    ADOQuery1.SQL.EXECSQL;为什么说UPDATE有错!
      

  3.   

    把这一行删掉
    ADOQuery1.SQL.Add(FROM temp,temp2);
      

  4.   

    出错,'参数test2.srsl没有默认值'
      

  5.   

    with adoquery1 do
      begin
        close;
        sql.Clear;
        sql.Add('update test1,test2 set hs=test2.srsl,je=test2.srje where test1.dwmc=test2.dwmc');
        execsql;
      end;
      showmessage('ok');测试通过。