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 7343D3CC9F7 for ; Fri, 17 Dec 2004 13:35:46 +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 65189-06 for ; Fri, 17 Dec 2004 13:35:40 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id F05593CC465 for ; Fri, 17 Dec 2004 13:35:42 +0000 (GMT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id iBHE8sT5028022; Fri, 17 Dec 2004 16:08:54 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id iBHE8rpa028018; Fri, 17 Dec 2004 16:08:53 +0200 Date: Fri, 17 Dec 2004 16:08:53 +0200 (EET) From: Achilleus Mantzios To: Kenneth Gonsalves Cc: Andreas Kretschmer , Subject: Re: [despammed] sql can i substitute In-Reply-To: <0412171831181R.06834@thenilgiris.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/123 X-Sequence-Number: 19743 O Kenneth Gonsalves έγραψε στις Dec 17, 2004 : > On Friday 17 December 2004 05:54 pm, Andreas Kretschmer wrote: > > > 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; > > can one do the same thing for an 'insert' statement? its an expression, so yes, INSERT INTO foo3 VALUES (2,case when 't' then 'bar' else 'foo' end); but whats the point? > > kg > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- -Achilleus