Re: MERGE as the imperative form of aggregation

From: Marshall <marshall.spight_at_gmail.com>
Date: 8 Apr 2007 10:03:35 -0700
Message-ID: <1176051815.801729.217560_at_o5g2000hsb.googlegroups.com>


On Apr 8, 8:54 am, paul c <toledobythe..._at_oohay.ac> wrote:
> Marshall wrote:
> > ...
> > So, what else has a transform that has a concept of
> > identity and also specifies a key? An aggregate
> > with GROUP BY.
>
> > MERGE NewFooCount f' into FooCount f
> > GROUP BY id
> > SET f.count = sum(f.count, f'.count);
>
> > It's less general, but syntactically and conceptually
> > cleaner and simpler.
> > ...
>
> I'd say MERGE is still a bastard because it operates on tuples, not
> relations, ie., a tuple in one operand is not necessarily in the result,
> whereas UNION, say, isn't like that. It appears to be using a label to
> hide the real construction, eg., "UPDATE OR INSERT".

Well, it doesn't seem so far off to say that all the imperative statements
operate on tuples. Alternatively, it doesn't seem so far off to say that all the imperative statements are bastards. :-)

Marshall Received on Sun Apr 08 2007 - 19:03:35 CEST

Original text of this message