X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 8674F925C5D for ; Fri, 30 May 2003 12:40:14 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 37703-10 for ; Fri, 30 May 2003 12:40:09 -0400 (EDT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by developer.postgresql.org (Postfix) with ESMTP id AA547925C40 for ; Fri, 30 May 2003 12:40:09 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 19LmvH-000Pqs-0W; Fri, 30 May 2003 17:40:08 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id A222E172E6; Fri, 30 May 2003 17:40:06 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 06F1816B3F; Fri, 30 May 2003 17:40:05 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: C F , pgsql-sql@postgresql.org Subject: Re: CASE returning multiple values (was SQL Help) Date: Fri, 30 May 2003 17:40:06 +0100 User-Agent: KMail/1.4.3 References: <20030530154703.37238.qmail@web20415.mail.yahoo.com> In-Reply-To: <20030530154703.37238.qmail@web20415.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305301740.06691.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/572 X-Sequence-Number: 13737 On Friday 30 May 2003 4:47 pm, C F wrote: > Hello, > I already tried this same basic question with no response.... maybe I was > too wordy. I think it's more a case of nobody seeing a better way. > select > (case when column1 =3D column2 then column3 end) as alias1, > (case when column1 =3D column2 then column4 end) as alias2, > (case when column1 =3D column2 then column5 end) as alias3, > (case when column6 =3D column7 then column8 end) as alias4 You could write a set returning function, but you'd just end up doing the s= ame=20 thing. Can you explain what it is you're trying to acheive - real=20 fields/schemas etc? --=20 Richard Huxton