Re: alias not applied - Mailing list pgsql-sql

From Tom Lane
Subject Re: alias not applied
Date
Msg-id 961.1171038340@sss.pgh.pa.us
Whole thread Raw
In response to alias not applied  ("Sabin Coanda" <sabin.coanda@deuromedia.ro>)
List pgsql-sql
"Sabin Coanda" <sabin.coanda@deuromedia.ro> writes:
> I have two queries:

> 1. SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 52 AS i, true AS d  ) x 
> ORDER BY i
> 2. SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 49 AS i, true AS d 
> UNION SELECT 51 AS i, true AS d  ) x ORDER BY i

> The first returns the columns "PK_ID", "Deleted"
> The second returns the columns i, d.

Works for me:

regression=# SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 52 AS i, true AS d  ) x ORDER BY i;PK_ID | Deleted
-------+---------   52 | t
(1 row)

regression=# SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 49 AS i, true AS d UNION SELECT 51 AS i, true AS d  ) x
ORDERBY i;PK_ID | Deleted
 
-------+---------   49 | t   51 | t
(2 rows)

regression=#

What PG version are you using, exactly?
        regards, tom lane


pgsql-sql by date:

Previous
From: Frank Bax
Date:
Subject: Re: alias not applied
Next
From: "Sabin Coanda"
Date:
Subject: Re: alias not applied