Re: Outer join by (+)



On Dec 17, 9:01 am, nova1...@xxxxxxxxx wrote:
There are two type to write select qurey left or right outer join

1.
from table1 left outer join table2 on (table1..column1=table2.column1)

2.
from table1, table2
where table1..column1=table2.column1(+)

Now I will add constant condation like table2.column2='AAAA'

it will be like this

1.
from table1 left outer join table2 on (table1..column1=table2.column1
and table2.column2='AAAA')

2.
from table1, table2
where table1..column1=table2.column1(+)
and table2.column2='AAAA'

but this is not left outer join becasue there is condition.

Question:
- How can I add this condition in secound case and still left outer
join?

I believe you'll have to do

from table1, table2
where table1.column1 = table2.column1(+)
and table2.column2(+) = 'AAAA'

- How can I make full outer join in secound case?

If I'm reading the docs of 10g properly you cannot do that with the
old syntax:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#i2054062

I'd generally prefer the OUTER JOIN syntax as it is more clear and
easier to grasp. Also, it has higher expressiveness. See here for
explanation: http://optimizermagic.blogspot.com/2007/12/outerjoins-in-oracle.html

Kind regards

robert
.



Relevant Pages

  • Re: Outer join by (+)
    ... from table1 left outer join table2 on ... from table1, table2 ... Kind regards ...
    (comp.databases.oracle.server)
  • Outer join by (+)
    ... There are two type to write select qurey left or right outer join ... from table1 left outer join table2 on ... from table1, table2 ... How can I make full outer join in secound case? ...
    (comp.databases.oracle.server)
  • Re: ProCobol Outer join
    ... vehicle, ... from Table1 A LEFT OUTER JOIN Table2 B ... Just change LEFT OUTER JOIN to FULL OUTER ...
    (comp.lang.cobol)
  • Re: OUTER JOIN syntax with more than two tables
    ... FROM TABLE1 A LEFT OUTER JOIN TABLE2 B ... Prev by Date: ...
    (borland.public.delphi.database.ado)
  • Re: Optimising the Query
    ... SUM ... FROM TABLE1 TAB1 ... FROM TABLE3 ... The query is taking records from TABLE2 and TABLE3 and LEFT OUTER JOIN ...
    (comp.databases.oracle.misc)