LEFT OUTER JOIN [message #206814] |
Fri, 01 December 2006 11:25 |
pradkuamr
Messages: 29 Registered: November 2006
|
Junior Member |
|
|
Hi
I am a ahving doubt on left outer join.
Here are two different codes which I am using.
Select T1.A, T2.B
from T1, T2
WHERE T1.ID = T2.ID(+) AND T2.Current_IND = 'Y'
Select T1.A, T2.B
from T1
LEFT OUTER JOIN T2 ON T1.ID = T2.ID AND T2.Current_ind = 'Y'
Do both perform same operation
|
|
|
Re: LEFT OUTER JOIN [message #206832 is a reply to message #206814] |
Fri, 01 December 2006 12:40 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
hm, I don't know the ansi syntax, so I don't know if the first one should be a left or a right outer join, but I do know that the first one is just an inner join, because of the T2.Current_IND = 'Y'.
[Updated on: Fri, 01 December 2006 12:40] Report message to a moderator
|
|
|
|
Re: LEFT OUTER JOIN [message #206909 is a reply to message #206896] |
Sat, 02 December 2006 03:32 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
Actually, it's the other way around...
in ansi syntax is:
LEFT OUTER JOIN T2 ON T1.ID = T2.ID
Please be aware that the outer join in the "original" syntax is not complete, this should be:
WHERE T1.ID = T2.ID(+)
AND T2.ID = 'Y'(+)
In ansi syntax you don't have to do this, the following works:
LEFT OUTER JOIN T2 ON T1.ID = T2.ID
AND T2.CURRENT_IND='Y'
|
|
|