Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle FULL OUTER JOIN

In Oracle, FULL OUTER JOIN is used to fetch all records from LEFT and RIGHT side table. It places NULL where the join condition is not met.

Oracle FULL OUTER JOIN Syntax

To fetch all records from LEFT and RIGHT side table, use the following syntax:

Syntax

SELECT col1, col2,....
FROM tablename1
FULL OUTER JOIN tablename2 
ON tablename1.col1 = tablename2.col1;

Parameters:

tablename1 & tablename2: The table name from which you want to fetch records.

col1: The column or field name that will be return.

Oracle FULL OUTER JOIN example

The following Oracle, fetching all "banks" and "accountName" fields value from "tblbankheadquartersandaddress" table and from "tblbankdemataccountcharges" table using FULL OUTER JOIN:

Example

SELECT B.banks,A.accountName
FROM tblbankdemataccountcharges A 
FULL OUTER JOIN tblbankheadquartersandaddress B
ON A.bankId = B.pk LIMIT 6;

Note:

In the above example, we are fetching all "banks" and "accountName" fields value from "tblbankheadquartersandaddress" and "accountName" field from "tblbankdemataccountcharges" table using FULL OUTER JOIN.