X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8C8BC9DCD01 for ; Thu, 16 Feb 2006 11:42:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20306-09 for ; Thu, 16 Feb 2006 11:42:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtpout.eastlink.ca (smtpout.eastlink.ca [24.222.0.30]) by postgresql.org (Postfix) with ESMTP id 041739DC97D for ; Thu, 16 Feb 2006 11:42:04 -0400 (AST) Received: from ip01.eastlink.ca ([24.222.10.5]) by mta01.eastlink.ca (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0IUS008Q0E8OQYZ0@mta01.eastlink.ca> for pgsql-sql@postgresql.org; Thu, 16 Feb 2006 11:41:12 -0400 (AST) Received: from blk-224-208-192.eastlink.ca (HELO tickletrunk.engtech.eng) ([24.224.208.192]) by ip01.eastlink.ca with ESMTP; Thu, 16 Feb 2006 11:42:06 -0400 Date: Thu, 16 Feb 2006 11:42:05 -0400 From: Michael Burke Subject: Re: Using calculated columns as arguments in same SELECT In-reply-to: <200602161107.50608.michael@engtech.ca> To: pgsql-sql@postgresql.org Message-id: <200602161142.05657.michael@engtech.ca> Organization: Engineering Technologies Canada Ltd. MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAQAAA+k= References: <200602161107.50608.michael@engtech.ca> User-Agent: KMail/1.8.3 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200602/207 X-Sequence-Number: 24217 On February 16, 2006 11:07 am, Michael Burke wrote: > Hello, > > I am looking to simplify this query (uses PostGIS, but I have encountered > this scenario with other chains of functions): > -- snip -- Immediately after sending this one, I realized I could do it with a sub-select: gtest=# SELECT X(SubSel.transformed_geom), Y(SubSel.transformed_geom) FROM ( SELECT SetSRID( Transform( GeomFromText( 'POINT(142512 1020225)', 26910 ), 4326 ), -1) AS transformed_geom) SubSel; This works fine. Mike. -- Michael Burke Engineering Technologies Canada Ltd. michael@engtech.ca 1 (902) 628-1705