Worst SQL Noob
Worst SQL Noob

Reputation: 189

Oracle SQL: Meaning of (+)= in WHERE clause

I have a question about the using of (+)= in the where clause in Oracle database;

  1. a. id= b.id(+)

Does that mean a left join that a left join on b where a.id=b.id, right?

  1. a.Job_Type(+) = 'Manager'

I don't understand why he uses (+)= here, but not a.Job_Type = 'Manager', are they the same?

Upvotes: 1

Views: 6287

Answers (2)

Douglas Ribeiro
Douglas Ribeiro

Reputation: 3005

The (+) identifies the table that is being outer joined to. The way I was taught, the (+) indicated the table that would have missing rows for which new NULL rows had to be added.

If you look at the alternate left outer join syntaxes that various databases supported before LEFT OUTER JOIN became part of the ANSI standard, the proprietary operator was generally applied to the table that was "missing" rows. DB2 also supports the (+) operator for outer joins in the same way that Oracle does.

Answer: Old Style Oracle Outer Join Syntax - Why locate the (+) on the right side of the equals sign in a Left Outer join?

Upvotes: 0

samer
samer

Reputation: 193

it works like LEFT JOIN and RIGHT JOIN depending on the table that column belong to you can read about different types of JOINS here

in your case (+) will return the all records from table which has alias a and only those records from table which has alias b that intersect with table alias a.

Upvotes: 2

Related Questions