Re: CASE returning multiple values (was SQL Help)

From: Richard Huxton <dev(at)archonet(dot)com>
To: C F <tacnaboyz(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: CASE returning multiple values (was SQL Help)
Date: 2003-05-30 16:40:06
Message-ID: 200305301740.06691.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • SQL Help at 2003-05-30 15:47:03 from C F

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Franco Bruno Borghesi 2003-05-30 17:12:30 Re: SQL Help
Previous Message Josh Berkus 2003-05-30 16:37:12 Re: SQL Help