Re: case statement as inline function?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>, pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Re: case statement as inline function?
Date: 2004-03-24 18:32:19
Message-ID: 200403241832.19501.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 24 March 2004 16:33, Mike Nolan wrote:
>
> Is there any way to treat it like an inline function so that I could write
> something like the following (highly simplified):

I think 7.4 will inline simple SQL functions. Your CASE looks like a good
candidate.

> select case when A=1 then 1 when B=1 then 2 else null end
> as mailtype, memname from master
> where mailtype is not null;

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shachar Shemesh 2004-03-24 18:38:42 Re: ole db
Previous Message Grace C. Unson 2004-03-24 18:30:03 Transaction Isolation Level