Advertisement

07.09.2007 at 07:07AM PDT, ID: 22683241
[x]
Attachment Details

question decode statement

Asked by ewang1205 in Oracle Database

Tags:

Here is my emp table and data.  What I want is in the decode statement, when it is true (Q), then I need empid in (10,20), otherwise, empid in 30.  I am open to any other solutionl ike case statement in the where clause.  Whatever works.  Thanks!

select * from emp;
     EMPID
        10
        20
        30

select * from emp where empid in decode('Q', 'Q', (10, 20), 30)


Start Free Trial
 
Loading Advertisement...
 
[+][-]07.09.2007 at 07:24AM PDT, ID: 19445402

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 07:30AM PDT, ID: 19445446

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 07:37AM PDT, ID: 19445504

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: statement
Sign Up Now!
Solution Provided By: jwahl
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.09.2007 at 10:19AM PDT, ID: 19446940

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32