Hi I have sql table I want to calculate all the fields to total sum field.
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- Is there a Delphi 5 component that can handle .png
- Is there a way to install Delphi 2010 on Windows 2
You can do this in the SELECT statement you use to get the data, something like
Obviously, you can add more numeric fields to the fields to sum.
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;