Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id EED929FB28C for ; Fri, 9 Feb 2007 12:04:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 83830-03 for ; Fri, 9 Feb 2007 12:04:09 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 585929FB264 for ; Fri, 9 Feb 2007 12:04:09 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id B02C030AF3; Fri, 9 Feb 2007 17:04:07 +0100 (MET) From: "Sabin Coanda" X-Newsgroups: pgsql.sql Subject: alias not applied Date: Fri, 9 Feb 2007 18:04:17 +0200 Organization: Hub.Org Networking Services Lines: 18 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/121 X-Sequence-Number: 27455 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