Re: [firebird-support] SUM(DC.I) / SUM(DC.Q) vs SUM(DC.I / DC.Q) why result is different?

2016-02-29 Thread Luigi Siciliano luigi...@tiscalinet.it [firebird-support]
Hallo, Il 29/02/2016 17.51, Fernando P. Nájera Cano y...@fernandonajera.com [firebird-support] ha scritto: > When you do SUM(DC.I / DC.Q), the value of the division is calculated > *per row*, and then those values are summed up. > > Fernando Nájera Ok, now I understand. Thank You -- Luigi

Re: [firebird-support] SUM(DC.I) / SUM(DC.Q) vs SUM(DC.I / DC.Q) why result is different?

2016-02-29 Thread Fernando P. Nájera Cano y...@fernandonajera.com [firebird-support]
Hi Luigi, > I not understand, > I have this table (DC): > A_IDIQ > 13701 > 23701 > sum(DC.I) is = 740 > and sum(DC.Q) is = 2 > then 740/2 = 370 > but > SUM(DC.I / DC.Q) it should be (740 / 2) = 370. Why not? > Why i am wrong? When you do SUM(DC.I / DC.Q), the value

Re: [firebird-support] SUM(DC.I) / SUM(DC.Q) vs SUM(DC.I / DC.Q) why result is different?

2016-02-29 Thread Luigi Siciliano luigi...@tiscalinet.it [firebird-support]
Hallo, Il 29/02/2016 15.31, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] ha scritto: > 29.02.2016 15:19, Luigi Siciliano luigi...@tiscalinet.it [firebird-support] > wrote: >> What is the difference from "SUM(DC.I) / SUM(DC.Q)" >> and "SUM(DC.I / DC.Q)" > 1/2 + 1/4 <> 2/6.

Re: [firebird-support] SUM(DC.I) / SUM(DC.Q) vs SUM(DC.I / DC.Q) why result is different?

2016-02-29 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
29.02.2016 15:19, Luigi Siciliano luigi...@tiscalinet.it [firebird-support] wrote: > What is the difference from "SUM(DC.I) / SUM(DC.Q)" > and "SUM(DC.I / DC.Q)" 1/2 + 1/4 <> 2/6. -- WBR, SD.

[firebird-support] SUM(DC.I) / SUM(DC.Q) vs SUM(DC.I / DC.Q) why result is different?

2016-02-29 Thread Luigi Siciliano luigi...@tiscalinet.it [firebird-support]
Hallo, I have, in DC table, two rows with same data: A_IDI Q 1 370 1 2 370 1 with this query: SELECT FIRST 1 DT.D as DCU, SUM(DC.I) / SUM(DC.Q) AS CU, (SELECT SUM(DC.I) / SUM(Q) FROM DOC_C DC WHERE DC.C > 0.00 AND DC.A_ID