Subject Re: [firebird-support] Is it possible calculate result of aggregates?
Author liviuslivius
Hi,

not so simple as you show but you can do:
1. calculated fields (if fields are from one table)
2. select from select :

SELECT
C
,C*5 AS D
FROM
(
SELECT
2+3 AS C
FROM
RDB$DATABASE
)

but this will be slower then repeated calculation i suppose

regards,
Karol Bieniaszewski

W dniu 2016-01-22 11:51:43 użytkownik Luigi Siciliano luigisic@... [firebird-support] <firebird-support@yahoogroups.com> napisał:
> How can I do this query:
>
> Select
> A,
> B,
> SUM(A + B) as C,
> C * A as D ----->>>>> FB result on "C not Exists" error!
> from
> table
> group by
> A,
> B
>
> Of course, I can do this: "SUM(A + B) * A as D" to perform my query but,
> I wish to learn if is possible the other one (C * A as D)
>
> Thanks.
> --
>
> Luigi Siciliano