pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmx.net>
To: Richard Sydney-Smith <richard@ibisaustralia.com>
To: pgsql-sql@postgresql.org
Subject: Re: Conversion from Sybase ASA
Date: Tue, 9 Sep 2003 09:17:26 +0200
Message-ID: <200309090917.26320.barwick@gmx.net> (raw)
In-Reply-To: <001001c376a0$ee48a8d0$f06832d2@athlon2000>
References: <001001c376a0$ee48a8d0$f06832d2@athlon2000>

On Tuesday 09 September 2003 09:06, Richard Sydney-Smith wrote:
> In sybase I can use the following syntax:
>
> select 'T' as src,(if tbon is null or tbon < '1900/12/12' or tbon >
> '1900/9/30' then 'U' else 'P' endif) as pres from ftrans
>
> this returns two columns: src = 'T' and pres which has either the value 'U'
> or 'P'
>
> how would I express this in postgresql?

"CASE":

http://www.postgresql.org/docs/7.3/static/functions-conditional.html

Ian Barwick
barwick@gmx.net




view thread (3+ messages)

Message-ID: <200309090917.26320.barwick@gmx.net>
Permalink:  ../200309090917.26320.barwick@gmx.net/
Also on:    postgresql.org/message-id/200309090917.26320.barwick@gmx.net

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barwick@gmx.net, richard@ibisaustralia.com
  Subject: Re: Conversion from Sybase ASA
  In-Reply-To: <200309090917.26320.barwick@gmx.net>

* 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