Re: Celko: help with an experiment

From: Steve Kass <skass_at_drew.edu>
Date: Thu, 11 Jul 2002 22:40:25 -0400
Message-ID: <3D2E4198.DB0BFDF3_at_drew.edu>


John,

  I'm apparently not being very clear here. I'm simply asking what the SQL-92 standard says. I'm not making or asking for judgements on what makes sense, or what good principles would require.

  The SQL-92 standard, by my reading, explicitly makes a distinction concerning whether a set expression references columns of the table. So I assume when you say that fact is "irrelevant," you mean irrelevant in some theoretical or practical sense, not irrelevant in my narrow sense of the SQL-92 standard alone. But if not, where in the SQL-92 standard do you find anything to support Joe's grouping on the phantom column?

  Maybe this is a better question: Does anyone care to comment on my interpretation of section 7.9.1.a.ii of the SQL-92 standard, which I think applies to the query specification

  select max(12) from T

and defines it to contain the same number of rows as T?

  The answer may well be no, that no one wishes to be a standards-pedant, but at least I'll feel like the question was heard.

Steve

John Jacob wrote:

> I have to agree with Joe here. Any expression within an aggregate
> operator invocation must be considered a pre-aggregate expression. The
> fact that it does not reference columns of the table being aggregated
> is irrelevant. To write it out explicitly:
>
> select max(Twelve) from (select 12 as Twelve from T) as T;
>
> Incidentally, the fact that the SQL language allows for such debates
> as this is a direct result of its poor design. A language in which
> aggregation was orthogonal to projection and extension would not
> suffer from these type of interpretation problems. Such a language
> exists (shameless plug) and is called D4. It is an 'Industrial D' as
> described by C. J. Date and Hugh Darwen in The Third Manifesto. Try it
> out at www.alphora.com.
>
> Regards,
> Bryn Rhodes
> Alphora
Received on Fri Jul 12 2002 - 04:40:25 CEST

Original text of this message