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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to JOIN with a OR

Status
Not open for further replies.

sahernandez

Programmer
Oct 1, 2002
69
SV
Hi , I have to JOIN a table with the condition OR, it's something like this:

select *
from tb1, tb2
where ( tb1.time_schedule = tb2.max_time(+)
or
tb1.time_real = tb2.max_time(+)
)

but ORACLE say, that I can't JOIN with a OR .

Any Idea to fix this problem.

Thxs
Alexander
 
I think Oracle is actually telling you you can't do an OUTER join with an OR.

To get around this, you might try:


select *
from tb1, tb2
where tb1.time_schedule = tb2.max_time(+)
UNION
select *
from tb1, tb2
where tb1.time_real = tb2.max_time(+);


 
Thxs Carp.

Do u know other different way to make this LEFT OUTER Join,
cause it's more than 100,000 rows that I have to JOIN with those tables
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top