Re: inconsistency in aliasing

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема Re: inconsistency in aliasing
Дата
Msg-id 20090114112748.GA5569@apartia.fr
обсуждение исходный текст
Ответ на Re: inconsistency in aliasing  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: inconsistency in aliasing
Re: inconsistency in aliasing
Список pgsql-general
On Wed, Jan 14, 2009 at 12:06:47PM +0100, A. Kretschmer wrote:
> In response to Louis-David Mitterrand :
> > Hi,
> >
> > This works:
> >
> >     critik=# select current_timestamp::abstime::int4 as score order by score;
> >
> > This doesn't:
> >
> >     critik=# select current_timestamp::abstime::int4 as score order by score + 1;
> >     ERROR:  column "score" does not exist
> >     LINE 1: ...urrent_timestamp::abstime::int4 as score order by score + 1 ...
> >
> > Any idea ?
>
> Yes, you can't use the alias in the ORDER BY. Use the real column-name.
>
> select current_timestamp::abstime::int4 as score order by
> current_timestamp::abstime::int4;

Did you try

"select current_timestamp::abstime::int4 as score order by score;" ?

This seems to be an "order by <alias>"

--
http://www.critikart.net

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

Предыдущее
От: ludwig@kni-online.de
Дата:
Сообщение: Re: inconsistency in aliasing
Следующее
От: "dbalinglung"
Дата:
Сообщение: Re: inconsistency in aliasing