Re: Possible parsing problem?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Possible parsing problem?
Дата
Msg-id 15468.1056992258@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Possible parsing problem?  (nolan@celery.tssi.com)
Список pgsql-general
nolan@celery.tssi.com writes:
> The following does NOT produce an error on the 'order by' clause,
> though perhaps it should?

>     SELECT col, count(*) from table group by col order by count;

AFAICS that is 100% correct per SQL92, given that we assign the default
name of "count" to the second result column.

> (FWIW, Oracle and MySQL both generate an error.)

They probably assign some other name to the column.  The spec leaves it
to the implementation what name to assign to output columns, except in
very trivial cases (or when you force the issue with AS).

            regards, tom lane

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

Предыдущее
От: Andrew Gould
Дата:
Сообщение: Re: Possible parsing problem?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PlPython