Re: U_SUMMARIZE: how aggregate is calculated?

From: Mikito Harakiri <mikharakiri_at_iahu.com>
Date: Wed, 1 Dec 2004 17:59:11 -0800
Message-ID: <DQurd.25$N87.164_at_news.oracle.com>


"Alfredo Novoa" <anovoa_at_ncs.es> wrote in message news:04qsq09g8s60vdepi32ajt5mlvocoh5ku2_at_4ax.com...
> On Wed, 1 Dec 2004 15:19:43 -0800, "Mikito Harakiri"
> <mikharakiri_at_iahu.com> wrote:
>
> >Suppose we have one column relation which is essentially a set of
intervals:
> >
> >{[1,2], [3,5], [4,7]}
> >
> >and I want to project away the interval column and calculate aggregated
> >value of SUM(1). What the result there would be? 3? 2? 7?
>
> It depends on what a sum of intervals is for you.
>
> For me it would be:
>
> {1,2} U {3,4,5} U {4,5,6,7} = {1,2,3,4,5,6,7} = [1,7]

SUM(col expression) indeed depends what "col expression is". If it's just the interval column itself, then you are right. BTW, shouldn't you also introduce user-defined aggregate SUM on the intervals?

In my case, however, the column expression is a constant equal to 1, so that the SUM has to be a number.

To clarify the difference more, compare

select sum(sal) from emp

to

select sum(1) from emp Received on Thu Dec 02 2004 - 02:59:11 CET

Original text of this message