Re: Why lower's not accept an AS declaration ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why lower's not accept an AS declaration ?
Дата
Msg-id 14956.1061253898@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why lower's not accept an AS declaration ?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Why lower's not accept an AS declaration ?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: 3 way outer join dilemma
Следующее
От: Jeffrey Melloy
Дата:
Сообщение: 'now' vs now() performance