pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Clark Evans <clark.evans@manhattanproject.com>
To: Jackson, DeJuan <djackson@cpsgroup.com>
Cc: Eduardo Noeda <enoeda@virtualsw.es>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] IIF..
Date: Tue, 30 Mar 1999 00:01:08 +0000
Message-ID: <37001444.785188C@manhattanproject.com> (raw)
References: <D05EF808F2DFD211AE4A00105AA1B5D20376A6@cpsmail>

"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



view thread (5+ messages)  latest in thread

Message-ID: <37001444.785188C@manhattanproject.com>
Permalink:  ../37001444.785188C@manhattanproject.com/
Also on:    postgresql.org/message-id/37001444.785188C@manhattanproject.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: clark.evans@manhattanproject.com, djackson@cpsgroup.com, enoeda@virtualsw.es
  Subject: Re: [SQL] IIF..
  In-Reply-To: <37001444.785188C@manhattanproject.com>
  References: <D05EF808F2DFD211AE4A00105AA1B5D20376A6@cpsmail> <37001444.785188C@manhattanproject.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox