How can I calculate sql tables in delphi ?

老子叫甜甜 提交于 2020-01-06 16:26:44

问题


Hi I have sql table I want to calculate all the fields to total sum field.


回答1:


You can do this in the SELECT statement you use to get the data, something like

SELECT *, big1 + small1 as "TotalSum" from adlar

Obviously, you can add more numeric fields to the fields to sum.




回答2:


procedure TForm1.Button1Click(Sender: TObject);

begin

ADOQuery1.Close;

ADOQuery1.SQL.Text:='select boyuk1 + kicik1 + qara1 + boyuk2 + kicik2 + boyuk3 * 0,35 as totalsum from adlar2v'; //(table name:adlar2v)

ADOQuery1.Open;

end;



来源:https://stackoverflow.com/questions/37291757/how-can-i-calculate-sql-tables-in-delphi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!