What is the difference between the various types of SQL JOIN? [duplicate]

2

In SQL there are several types of JOIN , what is the difference between INNER JOIN , LEFT JOIN , CROSS JOIN , RIGHT JOIN and FULL JOIN ?     

asked by anonymous 20.09.2016 / 03:25

1 answer

3

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:

Full join and Cross Join

Other Joins

    
20.09.2016 / 04:36