delphi 字段赋值
ADOQuery1.close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('SelectSum(shuliang)asqtyfromta...
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select Sum(shuliang) as qty from table1 where id =:a');
ADOQuery1.Parameters.ParamByName('a').Value:= Edit1.text;
ADOQuery1.Open;
像id=:a可以通过ADOQuery1.Parameters.ParamByName('a').Value:= Edit1.text;这种方式赋值,那要取Sum(shuliang) as qty 怎么办呀!
问题很菜,初学望详细讲解! 展开
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select Sum(shuliang) as qty from table1 where id =:a');
ADOQuery1.Parameters.ParamByName('a').Value:= Edit1.text;
ADOQuery1.Open;
像id=:a可以通过ADOQuery1.Parameters.ParamByName('a').Value:= Edit1.text;这种方式赋值,那要取Sum(shuliang) as qty 怎么办呀!
问题很菜,初学望详细讲解! 展开
2个回答
展开全部
ADOQuery1.SQL.Add('Select :XXX from table1 where id =:a');
ADOQuery1.Parameters.ParamByName('XXX ').Value:= AString;
ADOQuery1.Parameters.ParamByName('XXX ').Value:= AString;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询