Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> Actually, rereading SQL99, I wonder if it would expect this to work.
> Using 14.1's wording on order by clauses, syntax rule 18, h
Hmm ... that section is not exactly crystal-clear, is it? I had been
thinking of the part about deliberate incompatibilities with SQL92,
but rereading that, I see it only says they've eliminated the ability
to reference output columns by *number*, not by name.
Yet if they merely want to say "we allow expressions in the output
column names", why wouldn't they say that? This section is about ten
times longer than it would need to be to express that concept. I get
the impression that they're trying to compromise between allowing output
column names and input column names, but I sure don't follow exactly how
the compromise is supposed to work. And there are a ton of apparently-
unnecessary restrictions (no grouping, no subqueries in the sort keys)
that make me wonder what's going on.
Can anyone translate this part of the spec into plain English?
regards, tom lane