Difference between revisions of "Outer Joins"

From rbachwiki
Jump to navigation Jump to search
Line 2: Line 2:


'''An outer join can be created by using the WHERE clause with an outer join operator or the OUTER JOIN keywords'''
'''An outer join can be created by using the WHERE clause with an outer join operator or the OUTER JOIN keywords'''
===limitations when using the traditional approach to outer joins:===
==limitations when using the traditional approach to outer joins:==


* The outer join operator can be used for only one table in the joining condition.In other words, you can’t create NULL rows in both tables at the same time.
* The outer join operator can be used for only one table in the joining condition.In other words, you can’t create NULL rows in both tables at the same time.
* A condition that includes the outer join operator can’t use the IN or ORoperator.
* A condition that includes the outer join operator can’t use the IN or ORoperator.


==Outer Joins: JOIN Method==
When creating a traditional outer join with the outer join operator, the join can be applied
to only one table—not both. However, with the JOIN keyword, you can specify which table
the join should be applied to by using a left, right, or full outer join. Left and right outer joins
specify which table the outer join should be applied to, based on the table’s location in the
join condition. For example, a left outer join instructs Oracle to keep any rows in the table
listed on the left side of the join condition, even if no matches are found with the table listed
on the right. A full outer join keeps all rows from both tables in the results, no matter which
table is deficient when matching rows. (That is, it performs a combination of left and right
outer joins.)


[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]]
[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]]

Revision as of 00:58, 24 October 2017

An outer join is created when records needs to be included in the results without having a corresponding records in the join tables. These records are matched with the NULL records so that they are included in the output

An outer join can be created by using the WHERE clause with an outer join operator or the OUTER JOIN keywords

limitations when using the traditional approach to outer joins:

  • The outer join operator can be used for only one table in the joining condition.In other words, you can’t create NULL rows in both tables at the same time.
  • A condition that includes the outer join operator can’t use the IN or ORoperator.

Outer Joins: JOIN Method

When creating a traditional outer join with the outer join operator, the join can be applied to only one table—not both. However, with the JOIN keyword, you can specify which table the join should be applied to by using a left, right, or full outer join. Left and right outer joins specify which table the outer join should be applied to, based on the table’s location in the join condition. For example, a left outer join instructs Oracle to keep any rows in the table listed on the left side of the join condition, even if no matches are found with the table listed on the right. A full outer join keeps all rows from both tables in the results, no matter which table is deficient when matching rows. (That is, it performs a combination of left and right outer joins.)

Back To Top- Home - Category