Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4DE929FAE4E for ; Fri, 9 Feb 2007 12:20:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 93189-02 for ; Fri, 9 Feb 2007 12:20:04 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from tomts36-srv.bellnexxia.net (tomts36.bellnexxia.net [209.226.175.93]) by postgresql.org (Postfix) with ESMTP id 236FB9F9AFC for ; Fri, 9 Feb 2007 12:20:03 -0400 (AST) Received: from acer.sympatico.ca ([65.95.131.167]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070209162002.CNKB1862.tomts36-srv.bellnexxia.net@acer.sympatico.ca> for ; Fri, 9 Feb 2007 11:20:02 -0500 Message-Id: <5.2.1.1.0.20070209111848.00a70ec0@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Fri, 09 Feb 2007 11:19:58 -0500 To: pgsql-sql@postgresql.org From: Frank Bax Subject: Re: alias not applied In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/122 X-Sequence-Number: 27456 At 11:04 AM 2/9/07, Sabin Coanda wrote: >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 ? perhaps you are running an old version - both queries produce the same column names on my 8.2.1 system.