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.
Related
This question already has answers here:
Oracle "(+)" Operator
(4 answers)
How to find LEFT OUTER JOIN or RIGHT OUTER JOIN with ORACLE JOIN (+)
(2 answers)
Closed 7 years ago.
I'm quite new to oracle sql and just ran into a query that looks something like this
SELECT some_field
FROM some_table
WHERE some_other_field=some_value(+);
I simplified and annonimized the code, but im curious whats the (+) at the end. I don't remember seeing that in mssql world ever.
It's Oracle old outer join syntax:
To write a query that performs an outer join of tables A and B and
returns all rows from A (a left outer join), use the LEFT [OUTER] JOIN
syntax in the FROM clause, or apply the outer join operator (+) to all
columns of B in the join condition in the WHERE clause. For all rows
in A that have no matching rows in B, Oracle Database returns null for
any select list expressions containing columns of B.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/queries006.htm
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:
INNER JOIN ON vs WHERE clause
(12 answers)
Closed 9 years ago.
imagine I have 2 simple tables
users (id,username,password)
shopping(user_id,product_id)
and I use inner join to find each username buys which product :
select username,product_id
from shopping
inner join users
on users.id=shopping.user_id
but I can write a more simple query without using inner join and it works
select username,product_id
from shopping,users
where shopping.user_id=users.id
and result is the same
I wonder to know what's the advantage of using inner join !!
Inner Join is Used to Extract the Data's from one or more tables, that's why we are going for inner join instead of Where condition
SQL statements are synonymous, though specifying the INNER JOIN is the preferred method and follows ISO format. I prefer it as well because it limits the plumbing of joining the tables from your where clause and makes the goal of your query clearer.
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.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
When or why would you use a right outer join instead of left?
What ever the functionality i get with left outer join i can get it by interchanging table names.Then, what is the need for having two outer joins ( left and right) ? If there is any specific need can some body explain with an example ?
Why do we use >= when < does the same thing?
Mostly it's a convenience thing.
They're the same thing, use whichever makes more sense to your mind when reading the query.