troubleshooting Question

Select CASE in Oracle

Avatar of mrong
mrong asked on
Oracle Database
5 Comments3 Solutions315 ViewsLast Modified:
Greeting,
I have a field named 'zone'  in tbl1 with following data in Oracle
MA-01
MA-02
CU-01
CU-02
I also have the following select stmt.
Select ...
from tbl1
where zone=?
Below is result I want to have in my select stmt
if ?= ** ALL **, then the result needs to be the following:
** ALL **
MA-01
MA-02
CU-01
CU-02
if ?= ** MA **, then the result needs to be the following:
** ALL **
MA-01
MA-02
if ?= ** CU **, then the result needs to be the following:
** ALL **
CU-01
CU-02

Thanks in advance.


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros