Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> Okay, I think many of the random restrictions (in 2a, the grouping,
> distinct, set function spec) are to stop you from doing things like:
> select distinct a from table order by b;
> select a,min(b) from table group by a order by c;
> select count(*) from table order by a;
> All of which seem badly defined to me
Agreed, but restrictions on those grounds should be identical to the
restrictions on what you can write in a SELECT-list item. AFAICT the
restrictions actually cited here are quite different.
> The whole definition of simple table query seems to boil down to the fact
> that the query expression must be a query specification (which would
> appear to kill UNION/INTERSECT/EXCEPT, which makes sense since input
> column names aren't necessarily meaningful in that case).
Right, you could only use output column names for an ORDER BY on a
UNION/etc. We have that restriction already. But is that really all
they're saying here?
regards, tom lane