Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QUERY DIFFERENT TABLES DEPENDING ON VALUE

Status
Not open for further replies.

fragolita

Programmer
Aug 22, 2006
11
IT
Hi all!

I have to create the following report:

1. I query column1,column2 from Table A
2. depending on column2 value I have to access to different tables: B1, B2 to get more information which must be displayed on my report

How can i do it??
Can you recommend me some tutorial?
Thanks!!


 
You may try using DECODE, something like
Code:
select
a.column1
, a.column2
, DECODE(a.column2, 'B1', b1.value, 'B2', b2.value)
from
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top