(Moderator)
Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.858 Beiträge
Delphi 11 Alexandria
|
AW: SUM Werte im Union addieren
25. Apr 2012, 15:03
SQL-Code:
select
sum( ...), ...
from
((select
FLD01, Decimal(sum(FLD02), 7, 2)
from tridatt.oldph
where FLD03 In ('17', '18')
group by FLD01)
union
(select
FLD01, Round(((Decimal(sum(FLD02), 7, 2) / 5) * 3), 0)
from tridatt.oldph
where FLD03 In ('19')
group by FLD01)
order by FLD01 )
group by ...;
Markus Kinzler
|
|
Zitat
|