X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3E4ABD1B527 for ; Tue, 9 Sep 2003 07:05:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 37604-02 for ; Tue, 9 Sep 2003 04:04:53 -0300 (ADT) Received: from server146.hostingrevolution.com (server146.hostingrevolution.com [64.21.143.245]) by svr1.postgresql.org (Postfix) with ESMTP id E6296D1B503 for ; Tue, 9 Sep 2003 04:04:51 -0300 (ADT) Received: from 240.a.003.pth.iprimus.net.au ([210.50.104.240] helo=athlon2000) by server146.hostingrevolution.com with smtp (Exim 4.22) id 19wcYV-00036L-3B for pgsql-sql@postgresql.org; Tue, 09 Sep 2003 02:04:30 -0500 Message-ID: <001001c376a0$ee48a8d0$f06832d2@athlon2000> From: "Richard Sydney-Smith" To: Subject: Conversion from Sybase ASA Date: Tue, 9 Sep 2003 15:06:40 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C376E3.F8E903A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server146.hostingrevolution.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - ibisaustralia.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=HTML_50_60, HTML_FONT_COLOR_BLUE, HTML_FONT_COLOR_GREEN, HTML_FONT_COLOR_UNSAFE X-Spam-Level: X-Archive-Number: 200309/57 X-Sequence-Number: 15035 This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C376E3.F8E903A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 =3D 'T' and pres which has either the value '= U' or 'P' how would I express this in postgresql? thanks Richard ------=_NextPart_000_000D_01C376E3.F8E903A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
In sybase I can use the following=20 syntax:
 

select 'T' as src,(if tbon is nul= l or tb= on <=20 '1900/12/12' or= tbon >=20 '1900/9/30' then 'U'=20 else 'P' endif)= =20 as pres = from ftrans

this returns two columns: src =3D 'T' and pres which has = either=20 the value 'U' or 'P'

how would I express this in postgresql?

thanks

Richard

= ------=_NextPart_000_000D_01C376E3.F8E903A0--