Subject | Re: [firebird-support] SUM(DC.I) / SUM(DC.Q) vs SUM(DC.I / DC.Q) why result is different? |
---|---|
Author | Fernando P. Nájera Cano |
Post date | 2016-02-29T16:51:02Z |
Hi Luigi,
*per row*, and then those values are summed up.
So, you are doing this (see the last column):
Best regards,
Fernando Nájera
> I not understand,When you do SUM(DC.I / DC.Q), the value of the division is calculated
> I have this table (DC):
> A_ID I Q
> 1 370 1
> 2 370 1
> 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?
*per row*, and then those values are summed up.
So, you are doing this (see the last column):
> A_ID I Q I/QAnd therefore, SUM(I/Q) = 370+370 = 740
> 1 370 1 370/1=370
> 2 370 1 370/1=370
Best regards,
Fernando Nájera