The FULL Join condition returns values as per below rule:
All the matching data values from Table A and Table B.
All the non-matching data values from Left Table i.e. Table A and Right Table i.e. Table B.
FULL JOIN : keyword used for FULL JOIN, in order to fetch all the matching and non matching records from both the table
Table_name1/Table_name2 : The name of the first/second table from where you want to fetch the data
Column1Name : The name of the columns of the table based on which you want to join.
Let us consider a demo database with two tables Persons & Salary. Following is the structure of both the tables:
Figure 35.1. PERSONS TABLE
Figure 35.2. SALARY TABLE
The following SQL statement selects all the matching and non –matching records from Persons table (Left Table) and Salary Table (Right table)
Figure 35.3. FULL OUTER JOIN OUTPUT
Note: FULL OUTER JOIN and FULL JOIN are the same.
Want More SQL Deep Dives