Re: Conversion from Sybase ASA

From: Ian Barwick <barwick(at)gmx(dot)net>
To: "Richard Sydney-Smith" <richard(at)ibisaustralia(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Conversion from Sybase ASA
Date: 2003-09-09 07:17:26
Message-ID: 200309090917.26320.barwick@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)gmx(dot)net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jainendra Kumar P 2003-09-09 08:09:10 How can I optimize this query
Previous Message Richard Sydney-Smith 2003-09-09 07:06:40 Conversion from Sybase ASA