update tt set num1=num1+:anum where district_id=1;
这条语句在delphi中不正确,我想实现的目的就是在原有的num1基础上加上一定的数值

解决方案 »

  1.   

    sqlstring := 'update tt set num1=num1'+StrToInt(anum)+' where district_id=1';
      

  2.   

    Sql.text:='Update tt set Num1=Num1+'+InttoStr(变量)+'where District_ID=1'
      

  3.   

    update tt set num1=num1+''+StrToInt(anum)+'' where district_id=1;
      

  4.   

    var
      StrSelect:string;
      Num:Integer;
    begin
      StrSelect:=update tt set num1=num1+:anum where district_id=1;
      Num:='你要加的数据';
      xxxxxx.Parameters.ParamValues['anum']:='%'+Num+'%';
    end;
    未验证!
      

  5.   

    :anum是参数要传递值的Parameters.ParamValues['anum']:='%'+Num+'%';
      

  6.   

    update tt set num1=inttostr(strtoint(num1)+anum) where district_id=1;