We help IT Professionals succeed at work.

Conditional Query in Oracle

mrong
mrong asked
on
188 Views
Last Modified: 2014-08-22
Greeting,

I need suggestion on a conditional query in Oracle like the followings.
say I have a table TBL1 with field1,field2 and field3.
I want to have select statement like the following


if TBL1.field1= 'X' then TBL1 left join TBL2
if TBL1.field1= 'Y' then TBL1 left join TBL3
if TBL1.field1= 'Z' then TBL1 left join TBL4


thanks.
Comment
Watch Question

Senior Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
awking00Information Technology Specialist
CERTIFIED EXPERT

Commented:
Is field1 in tbl1 always going to contain only 'X' or "Y" or 'Z"?
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.