Search Postgresql Archives

Re: inconsistency in aliasing

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

 



2009/1/14 Daniel Verite <daniel@xxxxxxxxxxxxxxxx>:
>        Lennin Caro wrote:
>
>> select score,score+1 as score2 from (
>> select current_timestamp::abstime::int4 as score)
>> order by score2
>
> That additional score2 is not needed in the select output.
>
> This works just fine:
>
> => select score from (select current_timestamp::abstime::int4 as score)
> subsel order by score+1;
>

I'm been watching that the string name of order by with operator just work fine
if the column name is in the select clause. But if you use alias this
not work...

I'm don't believe is a bug, is a string name question. You can't add 1
to an alias,
but you can add 1 to a field... but the results is the same

> The point is that the subselect makes "score" available as a valid
> expression to the upper select.
>
> Best regards,
> --
> Daniel
> PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



-- 
      Emanuel Calvo Franco
   ArPUG / AOSUG Member
 Postgresql Support & Admin

-- 
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