This question already has answers here:
Difference between Oracle's plus (+) notation and ansi JOIN notation?
(8 answers)
Closed 9 years ago.
I want to know what the (+) in the below query signify,
select ..
from ..., Fat fat
where prop = fat.prop (+)
Thanks
It is the obsolete outer join symbol.
In Oracle, (+) denotes the "optional" table in the JOIN.
You may check out this for Left and Right Outer Joins.
On a side note:-(Although its obsolete)
The placement of the (+) determines RIGHT or LEFT. If the (+) is on the right, it's a LEFT JOIN and if (+) is on the left, it's a RIGHT JOIN.
For Oracle specifically, indicates a Left Outer Join. Older notation.
Out of date format of outer join. Means only matching rows on the (+) sign side and all rows on the other side. You should use the LEFT/RIGHT OUTER JOIN notation instead.
Related
This question already has answers here:
LEFT JOIN vs. LEFT OUTER JOIN in SQL Server
(12 answers)
Closed 5 years ago.
LEFT JOIN and LEFT OUTER JOIN works exactly the same way.
Which means the keyword OUTER has no effect or it is optional.
Why do we include a keyword which has no effect in execution?
It is optional, I always assumed that it was originally there as its more descriptive.
However it doesn't actually mean anything as a join is either inner, left, right or full - so the outer key word can be inferred to be relevant for all but inner joins.
This question already has answers here:
Oracle: What does `(+)` do in a WHERE clause?
(4 answers)
Closed 5 years ago.
Recently I observed the following syntax:
AND TRUNC (SYSDATE) + 1 BETWEEN a(+) AND b(+)
I know that the (+) sign is used to address left or right join in conditions like:
and a = b(+)
... but I have no idea what it means in the BETWEEN function.
Can someone explain, please, or better give an example using BETWEEN function?
Thank you,
The Oracle docs says:
Oracle recommends that you use the FROM clause OUTER JOIN syntax
rather than the Oracle join operator. Outer join queries that use the
Oracle join operator (+) are subject to the following rules and
restrictions, which do not apply to the FROM clause OUTER JOIN syntax:
This question already has answers here:
SQL Server *= Operator?
(6 answers)
Closed 8 years ago.
I just saw the weirdest thing ever in some very old SQL code we have.
There is a multiply equals operator in a where clause. Does it have a special meaning? It selects the appropriate columns, but o.name is NULL.
I am sure it is a typo, but I just want to confirm.
select c.name,
c.status,
o.name
from syscolumns c,
sysobjects o
where c.id = object_id('dbo.MyTable')
and c.cdefault *= o.id
order by colid asc
This question was already answered here: SQL Server *= Operator?
Beyond being the oldschool way, as fancyPants mentioned, it also may not always work consistently. You should revise your SQL statement to include the JOINS in the FROM clause.
To answer your question: *= is a LEFT OUTER JOIN, while =* is a RIGHT OUTER JOIN
As mentioned, this is a LEFT OUTER JOIN. Similarly, =* is a RIGHT OUTER JOIN
That said, it shouldn't be used anymore, and you should use the full syntax.
*= (LEFT OUTER JOIN)
=* (RIGHT OUTER JOIN)
This question already has answers here:
Difference between Oracle's plus (+) notation and ansi JOIN notation?
(8 answers)
Closed 9 years ago.
I'm going through some code and came across a view and was wondering what part of the WHERE statement was doing, it looks like so.
receipt_note.receipt_num(+) = receipt_data.receipt_num
receipt_num is a NUMBER in the table. I just don't know what the (+) would be doing here. Is it adding 1 to that number, like in coding where you would do variable++
(+) is the (old) outer join operator in Oracle. It is specifying an outer join between the receipt_num columns of the receipt_note table and the receipt_data table.
This syntax is obsolete; new queries should use OUTER JOIN instead since it is more readable.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Oracle: What does (+) do in a WHERE clause?
Consider the simplified SQL query below, in an Oracle database environment (although I'm not sure that it's Oracle-specific):
SELECT
t0.foo, t1.bar
FROM
FIRST_TABLE t0, SECOND_TABLE t1
WHERE
t0.ID (+) = t1.ID;
What is that (+) notation for in the WHERE clause? I'm sorry if this is an ignorant newbie question, but it's been extremely difficult to search for on Google or StackOverflow... because even when using quote marks, search engines see a '+' sign and seem to want to treat it as some kind of a logical directive.
This is an Oracle-specific notation for an outer join. It means that it will include all rows from t1, and use NULLS in the t0 columns if there is no corresponding row in t0.
In standard SQL one would write:
SELECT t0.foo, t1.bar
FROM FIRST_TABLE t0
RIGHT OUTER JOIN SECOND_TABLE t1;
Oracle recommends not to use those joins anymore if your version supports ANSI joins (LEFT/RIGHT JOIN) :
Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator. Outer join queries that use the Oracle join operator (+) are subject to the following rules and restrictions […]