SQL: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:


=Overview=
=Overview=
=JOIN=
The SQL <code>JOIN</code> clause is used to combine rows from two or more tables, based on a related column between them.
==INNER JOIN==
Return records that have matching values in both tables.
==LEFT (OUTER) JOIN==
Return all records from the left table and the matching records from the right table.
==RIGHT (OUTER) JOIN==
Return all records from the right table and the matching records from the left table.
==FULL (OUTER) JOIN==
Returns all records when there is a match in either left or right table.

Revision as of 19:35, 21 May 2024

Internal

Overview

JOIN

The SQL JOIN clause is used to combine rows from two or more tables, based on a related column between them.

INNER JOIN

Return records that have matching values in both tables.

LEFT (OUTER) JOIN

Return all records from the left table and the matching records from the right table.

RIGHT (OUTER) JOIN

Return all records from the right table and the matching records from the left table.

FULL (OUTER) JOIN

Returns all records when there is a match in either left or right table.