Re: CASE

From: "c k" <shreeseva(dot)learning(at)gmail(dot)com>
To: "Bill Moran" <wmoran(at)collaborativefusion(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: CASE
Date: 2008-08-19 11:50:25
Message-ID: d8e7a1e30808190450q27f5c563hb5985633736dbf11@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I want to create a function as follows:

case variable=value1
SQL statements
case variable=value2
SQL statements
case else
end of case

CPK

On Tue, Aug 19, 2008 at 5:17 PM, Bill Moran
<wmoran(at)collaborativefusion(dot)com>wrote:

> In response to "c k" <shreeseva(dot)learning(at)gmail(dot)com>:
>
> > Is there any control structure statement similar to select case ... ? If
> yes
> > how to use it. I have tried to use, case when <expression> then
> <expression>
> > end, but not worked well as I want to use other control structures and
> sql
> > statements to be executed for each case.
>
> Personally, I don't understand the question.
>
> Perhaps if you provided an example of what you are trying to do with
> CASE WHEN and why it doesn't work for you.
>
> It _does_ sound like you need to be using something like pl/pgsql.
>
> --
> Bill Moran
> Collaborative Fusion Inc.
> http://people.collaborativefusion.com/~wmoran/<http://people.collaborativefusion.com/%7Ewmoran/>
>
> wmoran(at)collaborativefusion(dot)com
> Phone: 412-422-3463x4023
>

In response to

  • Re: CASE at 2008-08-19 11:47:44 from Bill Moran

Responses

  • Re: CASE at 2008-08-19 12:00:46 from Tino Wildenhain

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2008-08-19 11:51:23 Re: What's size of your PostgreSQL Database?
Previous Message Bill Moran 2008-08-19 11:47:44 Re: CASE