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 22DB6D1B4ED for ; Fri, 10 Oct 2003 05:52:58 +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 26379-05 for ; Fri, 10 Oct 2003 02:52:10 -0300 (ADT) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by svr1.postgresql.org (Postfix) with ESMTP id E465BD1B509 for ; Fri, 10 Oct 2003 02:52:07 -0300 (ADT) Received: from xp (lc12101 [192.168.1.101]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id h9A5gti04758 for ; Fri, 10 Oct 2003 14:42:55 +0900 Message-ID: <003501c38ef2$9c041950$6501a8c0@local.mst.co.jp> From: "Iain Sinclair" To: Subject: smart(er) column aliases Date: Fri, 10 Oct 2003 14:51:54 +0900 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0031_01C38F3E.0BB966B0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=BAYES_30, HTML_30_40, HTML_FONT_FACE_ODD X-Spam-Level: X-Archive-Number: 200310/148 X-Sequence-Number: 15548 This is a multi-part message in MIME format. ------=_NextPart_000_0031_01C38F3E.0BB966B0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0031_01C38F3E.0BB966B0 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
Hi all,
 
To take a simple example here is = what I=20 wanted to do:
 
   select 1 as one, 2 a= s two,=20 one + two as three;
 
but it doesn't work. I've checked= it out=20 though, and I found that I can do this:
 
   select one, two, one= + two=20 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=20 7.3 soon but I guess that the first query still doesn't work.
 
I'd just like to suggest to the g= urus=20 developing this DB that it would be realy cool if the first query was possi= ble.=20 For me it's just about 2 things: simplicity and efficiency. The queries I'm= =20 working on at the moment are a little too complex for my liking and the "1"= in=20 this example is typically a call to a very involved function whose result i= s=20 re-used in a number of calculations. Obviously, I only want to so it once, = and=20 and I want to keep the main query as simple as possible as things are alrea= dy=20 out of hand...
 
cheers all.
 
Iain
------=_NextPart_000_0031_01C38F3E.0BB966B0--