X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0301C3CC839 for ; Fri, 17 Dec 2004 12:24:59 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36214-03 for ; Fri, 17 Dec 2004 12:24:49 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by svr1.postgresql.org (Postfix) with ESMTP id 69A5F3CC83E for ; Fri, 17 Dec 2004 12:24:51 +0000 (GMT) Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CfHAB-0002hn-00 for pgsql-sql@postgresql.org; Fri, 17 Dec 2004 13:24:51 +0100 Received: from [194.25.154.138] (helo=pinguin.schollglas.com) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1CfHAB-00089m-00 for pgsql-sql@postgresql.org; Fri, 17 Dec 2004 13:24:51 +0100 Received: from kretschmer by pinguin.schollglas.com with local (Exim 3.33 #6) id 1CfHA5-000587-00 for pgsql-sql@postgresql.org; Fri, 17 Dec 2004 13:24:45 +0100 Date: Fri, 17 Dec 2004 13:24:45 +0100 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: [despammed] sql can i substitute Message-ID: <20041217122445.GA19602@Pinguin.wug-glas.de> References: <0412171655451H.06834@thenilgiris.com> <20041217114533.GA17038@Pinguin.wug-glas.de> <0412171748151J.06834@thenilgiris.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0412171748151J.06834@thenilgiris.com> User-Agent: Mutt/1.4i X-DEST: 208 X-MSMail-Priority: High X-MSMail-Virus: X5O!P%@AP[4PZX54(P^)7CC)7}-STANDARD-ANTIVIRUS-TEST-FILE!+H* X-Message-Flag: My name is root. Just root. And I am licensed to kill -9 X-PrivatMail: kretschmer@kaufbach.delug.de X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org X-LUG: http://lug-dd.schlittermann.de X-Handy: 0160 / 8256486 (privat) X-Fax: 035204 / 40505 (privat) X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.648 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_WHOIS, MISSING_MIMEOLE, X_MSMAIL_PRIORITY_HIGH X-Spam-Level: X-Archive-Number: 200412/118 X-Sequence-Number: 19738 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 ===