Re: using case statement

From: Robert Klemme <>
Date: Wed, 12 Mar 2008 00:47:01 -0700 (PDT)
Message-ID: <>

On Mar 12, 4:38 am, Pintu <> wrote:
> Hi Friends,

Did we meet before?

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


> 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