Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Use of "OR" condition in JOIN

Pjh-OracleMar 2 2007 — edited Mar 4 2007
I have a pair of tables (A and B) from an App that for a variety of reasons could be joined by a number of columns (C1 to C4). I'm trying to understand a JOIN created in a view that reads along these lines
SELECT <columnlist> FROM A,B
WHERE
(A.C1 = B.C1
OR
A.C2=B.C2
OR
A.C3=B.C3
OR
A.C4=B.C4)

All the columns reference are indexed.

The view now goes off into the wild blue yonder and fails to return anything in under several hours. If I eliminate one of the OR clauses I get a list result in a (painful) number of minutes.

I've never come across this use of OR clause before. Can anyone help point me to some documentation on it or explain what it is actually doing and whether there's a workaround (save for use of a UNION).
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2007
Added on Mar 2 2007
8 comments
2,231 views