Professional Documents
Culture Documents
Joins
Joins
Joins
Retrieving data from multiple tables are called as joins. Types of joins: 1) 2) 3) 4) 5) Equi joins Non Equi Joins Self Joins Outer Joins (Left/Right Outer Joins) Cross Joins
3) Outer Joins:
A join between 2 tables that returns the results of an inner join as well as unmatched rows of a table is a Outer Join. a) Left Outer Join: A join between 2 tables that returns the results of an inner join as well as unmatched rows of a Left Table is a Left Outer Join. b) Right Outer Join: A join between 2 tables that returns the results of an inner join as well as unmatched rows of a Right Table is a Right Outer Join. c) Full Outer Join: A join between 2 tables that returns the results of an inner join as well as the results of a left and right join is a Full Outer Join.
4) Self Join:
Join a table to itself by using a Self Join.
5) Cross Join:
All rows in the first table are joined to all rows in the second table.
Natural Join:
If table1 is naturally joins with table2, then automatically Oracle checks for the columns which have the same names and datatypes based on the columns then automatically it applies an Equi Join.
Using Clause:
It is used to join the data between 2 tables based on the common columns automatically it applies an Equi Join.
On Clause:
It is used to join the data between 2 tables based on the user define condition automatically it applies an Equi Join.