Re: inconsistency in aliasing - Mailing list pgsql-general

From Daniel Verite
Subject Re: inconsistency in aliasing
Date
Msg-id c95dacb0-d958-4c7c-90f4-e387314c46da@mm
Whole thread Raw
In response to Re: inconsistency in aliasing  (Lennin Caro <lennin.caro@yahoo.com>)
Responses Re: inconsistency in aliasing
List pgsql-general
    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;

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

pgsql-general by date:

Previous
From: Louis-David Mitterrand
Date:
Subject: Re: inconsistency in aliasing
Next
From: Emanuel Calvo Franco
Date:
Subject: Re: inconsistency in aliasing