Eins von beiden würde auch bei dir laufen:
Delphi-Quellcode:
With ADOQuery
Do
Begin
SQL.Text :=
'
SELECT SUM(Feld1) AS Summe1' + #10 +
'
,SUM(Feld2) AS Summe2' + #10 +
'
,SUM(Feld3) AS Summe3' + #10 +
'
,SUM(Feld1) + SUM(Feld2) + SUM(Feld3) AS SummeGesamt' + #10 +
'
FROM Tabelle';
Open;
With IrgendeineListBox.Items
Do
While not Eof
Do
Begin
Add(FieldbyName('
Summe1').AsString);
Next;
End;
//...
End;
With OracleQuery
Do
Begin
SQL.Text :=
'
SELECT SUM(Feld1) AS Summe1' + #10 +
'
,SUM(Feld2) AS Summe2' + #10 +
'
,SUM(Feld3) AS Summe3' + #10 +
'
,SUM(Feld1) + SUM(Feld2) + SUM(Feld3) AS SummeGesamt' + #10 +
'
FROM Tabelle';
Execute;
With IrgendeineListBox.Items
Do
While not Eof
Do
Begin
Add(FieldAsString('
Summe1'));
Next;
End;
End;
Edit1+2: Tippfehler...