On Tue, 19 Aug 2003, Tom Lane wrote:
> I said:
> > After reading over the spec again I finally realized the significance of
> > this bit:
>
> > i) Let X be any <column reference> directly contained in K(i).
> > ii) If X does not contain an explicit <table or query name> or
> > <correlation name>, then K(i) shall be a <column name> that
> > shall be equivalent to the name of exactly one column of
> > ST.
>
> Wait a second ... this is a classic case of reading what you expected
> rather than what's there. I thought that (ii) said "If X does not ...
> then X shall be ..." but that's not what it says --- the "then" says
> that the whole sort-key K(i) must be an output-column name.
Err, yeah. That's certainly different than reading that as then X shall
be. :(
> In other words, SQL99 does not allow expressions over output-column
> names. An output-column reference can only appear as a simple name
> (same as SQL92, and same as what we allow). SQL99 allows expressions
> over input-column names ... but only if the expressions use
> fully-qualified input-column names.
>
> This last is such a stupid restriction that I can't believe I'm reading
> it right; is it just too late at night for me?
Yeah. These rules don't seem to make much sense, why bother making
it a general value expression if you're going to limit it like that?
It almost makes me wonder what SQL200x is going to do to the clause.
How about we forget that I ever brought it up. ;)