Re: CASE returning multiple values (was SQL Help) - Mailing list pgsql-sql

From Richard Huxton
Subject Re: CASE returning multiple values (was SQL Help)
Date
Msg-id 200305301740.06691.dev@archonet.com
Whole thread Raw
In response to SQL Help  (C F <tacnaboyz@yahoo.com>)
Responses Re: CASE returning multiple values (was SQL Help)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: CASE returning multiple values (was SQL Help)  (C F <tacnaboyz@yahoo.com>)
List pgsql-sql
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 = column2 then column3 end) as alias1,
>   (case when column1 = column2 then column4 end) as alias2,
>   (case when column1 = column2 then column5 end) as alias3,
>   (case when column6 = column7 then column8 end) as alias4

You could write a set returning function, but you'd just end up doing the same
thing. Can you explain what it is you're trying to acheive - real
fields/schemas etc?

--  Richard Huxton


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: SQL Help
Next
From: Franco Bruno Borghesi
Date:
Subject: Re: SQL Help