Re: [despammed] sql can i substitute - Mailing list pgsql-sql

From Andreas Kretschmer
Subject Re: [despammed] sql can i substitute
Date
Msg-id 20041217122445.GA19602@Pinguin.wug-glas.de
Whole thread Raw
In response to Re: [despammed] sql can i substitute  (Kenneth Gonsalves <lawgon@thenilgiris.com>)
Responses Re: [despammed] sql can i substitute
List pgsql-sql
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  | goodBanana | badCherry | 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    === 


pgsql-sql by date:

Previous
From: Kenneth Gonsalves
Date:
Subject: Re: [despammed] sql can i substitute
Next
From: Richard Huxton
Date:
Subject: Re: can't get the order I want after inserting new rows