SQL Full Outer Join - SQL Outer Join with Examples



SQL Full Outer Join

  • The FULL OUTER JOIN keyword retrieves all records when there is a match in either the left (table1) or the right (table2) table records.

Syntax

SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;

Database :

  • Here is a portion from the "Wikitechy" table:
sql-table-Wikitechy-full-outer
  • Here is an excerpt from the " Student Detail " table:
sql-table-student-details-full-outer

Example of a FULL OUTER JOIN

Syntax

SELECT tbl_Wikitechy.Student_Name, tbl_Student_Detail .Student_Id
FROM tbl_Wikitechy
FULL OUTER JOIN tbl_Student_Detail ON tbl_Wikitechy.Student_Id=tbl_Student_Detail.Student_Id
ORDER BY tbl_Wikitechy.Student_Name;

Output

sql-outer-join-output

Related Searches to SQL Full Outer Join - SQL Outer Join with Examples