Re: using case statement

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Wed, 12 Mar 2008 00:47:01 -0700 (PDT)
Message-ID: <7f1d2c81-2c61-4555-88dc-b1e4ab51774e@a70g2000hsh.googlegroups.com>


On Mar 12, 4:38 am, Pintu <priyabratabeh..._at_gmail.com> wrote:
> Hi Friends,

Did we meet before?

> I want to use "in" clause in case statement as shown below.

Why?

> select * from employee
> where empid in
> case i_desgn
> when 'HR' then (1,2,3,4,5)
> when 'MD' then 1
> else 7
> end

As you have discovered this does not work. What are your conclusions?

> Though i did this using if-elsif but there is repetation of query. So
> i want this way to implement..

What kind of database supports if-elsif in a query? Certainly not Oracle but this is an Oracle group. I suggest you take a closer look at boolean logic.

> Please help as soon as possible..

We always do. But trying to push the community might prove counter productive.

robert Received on Wed Mar 12 2008 - 02:47:01 CDT

Original text of this message