1

while changing stored procedure i came across (+) = operator. I have read Oracle "(+)" Operator but seems like my problem is slightly different than one mentioned in that link. So, can anyone please help me understand statement like:

select ....
from emp, dept 
where emp.dept_id (+) = dept.dept_id

why would they use both + and = sign while using this condition? I would be thankful if someone will help me with example or link where i can read about such operators.

Community
  • 1
  • 1
codiacTushki
  • 750
  • 1
  • 9
  • 22
  • 2
    This is the old Oracle syntax for left and right outer joins. Learn the proper ANSI syntax and don't use this. In fact, just avoid having commas in the `from` clause, and your queries will be better. – Gordon Linoff Apr 29 '14 at 11:24
  • Oracle joins : http://docs.oracle.com/cd/B19306_01/server.102/b14200/queries006.htm – MaVRoSCy Apr 29 '14 at 11:25
  • Thanks Gordon. are there any downsites of using commas in the oracle from clause? – codiacTushki Apr 29 '14 at 11:27

2 Answers2

1

The (+)= operator refers to Oracle outer Joins wich simply extends the functionality of simple joins.

See the following link on this operator and this link on how to use it with example

MaVRoSCy
  • 17,747
  • 15
  • 82
  • 125
1

This is the deprecated notation of a LEFT OUTER JOIN.

The new and preferred notation according to the ANSI standard is:

select ....
from emp
left outer join dept 
on emp.dept_id = dept.dept_id
wvdz
  • 16,251
  • 4
  • 53
  • 90