Re: Group by -- precedence question

Поиск
Список
Период
Сортировка
От Jov
Тема Re: Group by -- precedence question
Дата
Msg-id CADyrUxOGiTASvQV_rt0oq6wXdmCO_UVGQCRB4L0Rum=_gw=Ekw@mail.gmail.com
обсуждение исходный текст
Ответ на Group by -- precedence question  (Joe Van Dyk <joe@tanga.com>)
Список pgsql-general

jov
On Mar 23, 2013 9:26 AM, "Joe Van Dyk" <joe@tanga.com> wrote:
>
> begin;
> create table f (v numeric);
> insert into f values (1), (0.8);
> select ceil(v) as v from f group by v;
>
> -- sorta expected the result to be grouped by the column alias,
> -- not by the in the table
>
>  v
> ───
>  1
>  1
>
> This is the correct behavior, right? To group by the column alias, I'd have to use "group by 1" or use a different name, right?
both right.

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

Предыдущее
От: Joe Van Dyk
Дата:
Сообщение: Group by -- precedence question
Следующее
От: Sergey Konoplev
Дата:
Сообщение: timeofday() and clock_timestamp() produce different results when casting to timestamptz