In SQL there are several types of JOIN
, what is the difference between INNER JOIN
, LEFT JOIN
, CROSS JOIN
, RIGHT JOIN
and FULL JOIN
?
In SQL there are several types of JOIN
, what is the difference between INNER JOIN
, LEFT JOIN
, CROSS JOIN
, RIGHT JOIN
and FULL JOIN
?
Being minimal, and considering that A is always the table on the left, and B on the right:
Inner Join
= only records bound in tables A and B
Left Join
= all records of A, only records bound to B.
Right Join
= all records of B, only records bound to A.
Cross Join
= all linked records of A and B, all A lines and all B lines, as well as replicas of A and B lines with variations between records of the same tables.
Full Join
= Left Join and Right Join together. Lines that are not bound will not appear.
Links: