Received: from smtp0.mindspring.com (smtp0.mindspring.com [207.69.200.30]) by hub.org (8.9.2/8.9.1) with ESMTP id TAA55559 for ; Mon, 29 Mar 1999 19:05:05 -0500 (EST) (envelope-from clark.evans@manhattanproject.com) Received: from manhattanproject.com (pool-209-138-0-147.nwrk.grid.net [209.138.0.147]) by smtp0.mindspring.com (8.8.5/8.8.5) with ESMTP id TAA13690; Mon, 29 Mar 1999 19:04:59 -0500 (EST) Sender: clark@mindspring.com Message-ID: <37001444.785188C@manhattanproject.com> Date: Tue, 30 Mar 1999 00:01:08 +0000 From: Clark Evans X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: "Jackson, DeJuan" CC: Eduardo Noeda , pgsql-sql@postgreSQL.org Subject: Re: [SQL] IIF.. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Jackson, DeJuan" wrote: > It would be: > SELECT (CASE Number > WHEN 1 THEN 'First' > ELSE 'Other' > END) AS Description > FROM Table Way cool. A new trick for me. This is similar to DECODE, I assume. However, I tried this test on a snapshot about a week old, and this is the result: > Welcome to the POSTGRESQL interactive sql monitor: > Please read the file COPYRIGHT for copyright terms of POSTGRESQL > > type \? for help on slash commands > type \q to quit > type \g or terminate with semicolon to execute query > You are currently connected to the database: clark > > clark=> create table test (a text, b int4 ); > CREATE > clark=> insert into test values ( 'one', 1); > INSERT 18634 1 > clark=> insert into test values ( 'two', 2); > INSERT 18635 1 > clark=> insert into test values ( null, null); > INSERT 18636 > clark=> select ( case b when 1 then 'first' else 'other' end ) as xx from test; > ERROR: copyObject: don't know how to copy 704 > clark=> > Did this work in earlier versions? If so, then perhaps this should be added to a regression test if it isn't already. Best, Clark