From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sabin Coanda <sabin.coanda@deuromedia.ro>
Cc: pgsql-sql@postgresql.org
Subject: Re: alias not applied
Date: Fri, 09 Feb 2007 11:25:40 -0500
Message-ID: <961.1171038340@sss.pgh.pa.us> (raw)
In-Reply-To: <eqi61k$1h2h$1@news.hub.org>
References: <eqi61k$1h2h$1@news.hub.org>
"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 ORDER BY i;
PK_ID | Deleted
-------+---------
49 | t
51 | t
(2 rows)
regression=#
What PG version are you using, exactly?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, sabin.coanda@deuromedia.ro
Subject: Re: alias not applied
In-Reply-To: <961.1171038340@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox