Re: Column aliases in GROUP BY and HAVING

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Column aliases in GROUP BY and HAVING
Дата
Msg-id 20201012170352.GA16328@hjp.at
обсуждение исходный текст
Ответ на Re: Column aliases in GROUP BY and HAVING  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On 2020-10-12 10:40:03 -0400, Tom Lane wrote:
> "Peter J. Holzer" <hjp-pgsql@hjp.at> writes:
> > In the GROUP BY clause I can use the alias year which was defined
> > earlier in SELECT.
>
> This is a pretty unfortunate legacy thing that we support because
> backwards compatibility (and because "GROUP BY 1" is so frequently
> a handy shortcut).
[...]
> I think SQL versions newer than SQL92 disallow these references entirely.
>
> (I'm being fairly brief here, but this has all been litigated multiple
> times before.  See the archives.)

That's ok, you've answered my question. Thanks.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Any interest in adding match_recognize?
Следующее
От: John the Scott
Дата:
Сообщение: Re: rum index supported on pg13?