X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 74D93D1B4F5 for ; Sun, 14 Sep 2003 04:24:08 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 53130-05 for ; Sun, 14 Sep 2003 01:23:37 -0300 (ADT) Received: from server146.hostingrevolution.com (server146.hostingrevolution.com [64.21.143.245]) by svr1.postgresql.org (Postfix) with ESMTP id 83400D1B504 for ; Sun, 14 Sep 2003 01:23:35 -0300 (ADT) Received: from 007.a.002.pth.iprimus.net.au ([210.50.108.7] helo=athlon2000) by server146.hostingrevolution.com with smtp (Exim 4.22) id 19yOQB-00023E-7n for pgsql-sql@postgresql.org; Sat, 13 Sep 2003 23:23:14 -0500 Message-ID: <000f01c37a78$4ea53560$076c32d2@athlon2000> From: "Richard Sydney-Smith" To: Subject: Use derived expression in select statement Date: Sun, 14 Sep 2003 12:25:58 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server146.hostingrevolution.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - ibisaustralia.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/114 X-Sequence-Number: 15092 I am converting a database from Sybase and have found the following command does not work in the same fashion. select dy_c , dy_sect as tsect, (cy_bfwd + dy_p1T4) as curr_bal from fclitot where dy_yr = 0 and (curr_bal) <-0.005 In the actual command used curr_bal is calculated from a very much longer expression and rather than repeat the expression I simply refer to it by its assigned name in sybase. In postgres it tells me curr_bal is not found. is their a simular shorthand available in postgres? curr_bal is calc from about 12 fields :{ thanks Richard