Home » Other » Training & Certification » multiple values in then clause of Case statement (Oracle 10g)
multiple values in then clause of Case statement [message #339932] Sat, 09 August 2008 22:50 Go to next message
balcode
Messages: 4
Registered: November 2007
Junior Member
I want to return multiple value in the THEN clause of CASE statement.

SELECT c.company_code, c.com_inactive_flag, e.emp_no
FROM company c, employees e
WHERE c.com_code = e.com_code
AND e.emp_status in (
(CASE c.com_inactive_flag
WHEN 'N' THEN 'A'
WHEN 'Y' THEN 'B,C'
END)

If the flag is N all those employees will be retrieved whoe has status A otherwise all those who have B and C flag should be retrieved.

But because I have 'B,C' so it will not return anything. Is there anyway I can put 'B,C' etc. instead of just one value like 'B'.
Re: multiple values in then clause of Case statement [message #339937 is a reply to message #339932] Sat, 09 August 2008 23:33 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines in URL above
Re: multiple values in then clause of Case statement [message #339943 is a reply to message #339932] Sun, 10 August 2008 01:23 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, find another way.

Regards
Michel
Previous Topic: FREE...FREE ORACLE 10g UPGRADE TRAINING @ Q-Soft Bangalore!!
Next Topic: Informatica certification question.
Goto Forum:
  


Current Time: Sun Dec 11 06:20:41 CST 2016

Total time taken to generate the page: 0.23464 seconds