Search Postgresql Archives

Re: inconsistency in aliasing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 14, 2009 at 3:46 AM, Louis-David Mitterrand
<vindex+lists-pgsql-general@xxxxxxxxxxx> wrote:
> 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 ...

A number in an order by refers to a column.

select a, b, c/d as f from table order by 3;

will order by the third field in the select list.  I'm guessing the +
1 is trying to add col 1 to a field it can't find.  doubt it's a bug,
more like a quirk.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux