Conditional Join Logic [message #661503] |
Tue, 21 March 2017 23:30 |
|
rajsinha
Messages: 4 Registered: February 2016
|
Junior Member |
|
|
Hi,
I need to join 2 different tables on different columns in the same table. However, I need to fetch the records if either of the join condition is true..
Select
A.*
From A INNER JOIN TAB_A ON A.COLA = TAB_A.COLA
INNER JOIN TAB_B ON A.COLB = TAB_B.COLB
I want to simulate a logical OR condition between the joins and retrieve the record if either of the join conditions above is true.
Please advise.
|
|
|
|
Re: Conditional Join Logic [message #661507 is a reply to message #661503] |
Wed, 22 March 2017 02:39 |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
Hi,
I am not sure what exactly you mean with "join", but as the posted query sample is selecting only columns from the table A, using EXISTS/IN conditions and their proper combination (you would not "simulate" OR, just use it directly) should suffice.
[Edit: grammar, terminology]
[Updated on: Wed, 22 March 2017 02:41] Report message to a moderator
|
|
|
|