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 ===
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html