From: Iain Sinclair <iain@mst.co.jp>
To: pgsql-sql@postgresql.org
Subject: smart(er) column aliases
Date: Fri, 10 Oct 2003 14:51:54 +0900
Message-ID: <003501c38ef2$9c041950$6501a8c0@local.mst.co.jp> (raw)
Hi all,
To take a simple example here is what I wanted to do:
select 1 as one, 2 as two, one + two as three;
but it doesn't work. I've checked it out though, and I found that I can do
this:
select one, two, one + two from (select 1 as one, 2 as two) as a;
which is acceptable, I guess.
I'm using 7.1 (I think) and will update to 7.3 soon but I guess that the
first query still doesn't work.
I'd just like to suggest to the gurus developing this DB that it would be
realy cool if the first query was possible. For me it's just about 2 things:
simplicity and efficiency. The queries I'm working on at the moment are a
little too complex for my liking and the "1" in this example is typically a
call to a very involved function whose result is re-used in a number of
calculations. Obviously, I only want to so it once, and and I want to keep
the main query as simple as possible as things are already out of hand...
cheers all.
Iain
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: iain@mst.co.jp
Subject: Re: smart(er) column aliases
In-Reply-To: <003501c38ef2$9c041950$6501a8c0@local.mst.co.jp>
* 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