alias not applied

From: "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro>
To: pgsql-sql(at)postgresql(dot)org
Subject: alias not applied
Date: 2007-02-09 16:04:17
Message-ID: eqi61k$1h2h$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all,

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.

Why ?

TIA,
Sabin

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Bax 2007-02-09 16:19:58 Re: alias not applied
Previous Message Tom Lane 2007-02-09 15:24:37 Re: dynamic sql