SQL SUM(T)T1,SUM(T2)T2, [Tot - Tot] Difer Tem como?

Delphi

12/04/2006

Te como fazer Algo assim

SELECT SUM(TOTAL)Tot,
SUM(TOTAL2)Tot2,
[Tot - Tot] Difer
FROM esaped
WHERE CODCLI = 487

Preciso fazer isso, pois faço um subselect no lugar do campo TOTAL2
e para conseguir fazer essa subtração teria que fazer 2 subselect
do mesmo valor.


Acacio

Acacio

Curtidas 0

Respostas

Thomaz_prg

Thomaz_prg

12/04/2006

SELECT SUM(TOTAL) as Tot, 
SUM(TOTAL2) as Tot2, 
SUM(TOTAL - TOTAL2) as Difer 
FROM esaped 
WHERE CODCLI = 487



GOSTEI 0
POSTAR