pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Sydney-Smith <richard@ibisaustralia.com>
To: pgsql-sql@postgresql.org
Subject: Use derived expression in select statement
Date: Sun, 14 Sep 2003 12:25:58 +0800
Message-ID: <000f01c37a78$4ea53560$076c32d2@athlon2000> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <000f01c37a78$4ea53560$076c32d2@athlon2000>
Permalink:  ../000f01c37a78$4ea53560$076c32d2@athlon2000/
Also on:    postgresql.org/message-id/000f01c37a78$4ea53560$076c32d2@athlon2000

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: richard@ibisaustralia.com
  Subject: Re: Use derived expression in select statement
  In-Reply-To: <000f01c37a78$4ea53560$076c32d2@athlon2000>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox