Re: missing information and aggregates

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Fri, 5 Sep 2003 09:46:23 -0700
Message-ID: <Wd36b.21$pP2.69_at_news.oracle.com>


"Bob Badour" <bbadour_at_golden.net> wrote in message news:8rR5b.528$0o6.49213552_at_mantis.golden.net...
> "Christopher Browne" <cbbrowne_at_acm.org> wrote in message
> > The right Default Value for addition aggregates would be 0.
> >
> > The right Default Value for multiplicative aggregates would be 1.
>
> I think you are confusing default values with identity elements. 0 is the
> identity element for addition and 1 is the identity element for
> multiplication.

Identity elements are default values! It is obvious that aggregates should return non-null value at least in cases like these:

select sum(sal) from emp where 1=0

the correct result is 0, not the NULL (SQL standard?)

select multiply(sal) from emp where 1=0

the correct result is 1, not the NULL

select max(sal) from emp where 1=0

the correct result is minus infinity, not the NULL Received on Fri Sep 05 2003 - 18:46:23 CEST

Original text of this message