pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@despammed.com>
To: pgsql-sql@postgresql.org
Subject: Re: [despammed] sql can i substitute
Date: Fri, 17 Dec 2004 13:24:45 +0100
Message-ID: <20041217122445.GA19602@Pinguin.wug-glas.de> (raw)
In-Reply-To: <0412171748151J.06834@thenilgiris.com>
References: <0412171655451H.06834@thenilgiris.com>
	<20041217114533.GA17038@Pinguin.wug-glas.de>
	<0412171748151J.06834@thenilgiris.com>

am  17.12.2004, um 17:48:15 +0530 mailte Kenneth Gonsalves folgendes:
> 
> thanks - opened up a whole new world for me. One more thing, the values come 
> under the column 'case', can i avoid having the column 'case' and get the 
> 'good', 'bad' and 'rotten' under the column 'fruit'?

Yes, simple:

test=# select name,  case
test-# when fruit = 1 then 'good'
test-# when fruit = 2 then 'bad'
test-# when fruit = 3 then 'rotten' end as fruit from fruit;
  name  | fruit
--------+--------
 Apple  | good
 Banana | bad
 Cherry | rotten
(3 Zeilen)


Regards, Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
               Tel. NL Heynitz:  035242/47212
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    === 



view thread (10+ messages)  latest in thread

Message-ID: <20041217122445.GA19602@Pinguin.wug-glas.de>
Permalink:  ../20041217122445.GA19602@Pinguin.wug-glas.de/
Also on:    postgresql.org/message-id/20041217122445.GA19602@Pinguin.wug-glas.de

 · 

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: akretschmer@despammed.com
  Subject: Re: [despammed] sql can i substitute
  In-Reply-To: <20041217122445.GA19602@Pinguin.wug-glas.de>

* 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