pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: C F <tacnaboyz@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: CASE returning multiple values (was SQL Help)
Date: Fri, 30 May 2003 17:40:06 +0100
Message-ID: <200305301740.06691.dev@archonet.com> (raw)
In-Reply-To: <20030530154703.37238.qmail@web20415.mail.yahoo.com>
References: <20030530154703.37238.qmail@web20415.mail.yahoo.com>

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



view thread (4+ messages)  latest in thread

Message-ID: <200305301740.06691.dev@archonet.com>
Permalink:  ../200305301740.06691.dev@archonet.com/
Also on:    postgresql.org/message-id/200305301740.06691.dev@archonet.com

 · 

reply

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: dev@archonet.com, tacnaboyz@yahoo.com
  Subject: Re: CASE returning multiple values (was SQL Help)
  In-Reply-To: <200305301740.06691.dev@archonet.com>

* 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