Re: What is Aggregation? Re: grouping in tuple relational calculus

From: Vadim Tropashko <vadimtro_invalid_at_yahoo.com>
Date: 18 Feb 2005 18:05:11 -0800
Message-ID: <1108778711.687239.8870_at_z14g2000cwz.googlegroups.com>


Mikito Harakiri wrote:
> Well, the analogy is not quite complete. In your example, the mapping
is an
> extended projection that creates an extra column:
>
> select figure, sum(1) from
> {circle, circle, square, triangle}
> group by figure
>
> From from the projection enhanced with the counter, we can restore
the
> original multiset back.
>
> Then, perhaps, ordering creates a pseudocolumn with a similar purpose
too?
> Well, it's not a hard to figure out what this column should be. The
ordering
> example should look like this
>
> select figure, seq# from
> circle->square->circle->triangle
> order by figure
>
> with the return result
>
> (circle,1)
> (circle,3)
> (square,2)
> (triangle,4)

What is seq#? Perhaps, just sum(1) aggregate operator would do? Then, the proposed syntax seems to increase expressive power to what is otherwise known as SQL analytics. We can calculate any running total, not only count. It also answers the question appeared earlier in the thread whether noncommutative aggregate functions make sence. Received on Sat Feb 19 2005 - 03:05:11 CET

Original text of this message