Subject Re: [ib-support] Count value on field
Author Claudio Valderrama C.
""Bayu"" <bayu2000@...> wrote in message
> Hello Martin and Luc
> > NULL means the state of 'unknown'.
> >
> > value + unknown = unknown
> But why select sum(d_imip) from transaksi will give me the right result ?

By design, SUM, AVG, MAX and MIN skip null values. The only case when those
functions return NULL is when the whole column is NULL. In contrast, COUNT
never returns NULL. The net result is that in a table with fields A, B & C
that are nullable, the expression
select sum (A + B + C)
gives different results than
select sum (A) + sum (B) + sum (C)
in the general case.

Claudio Valderrama C. - -
Independent developer
Owner of the Interbase® WebRing