3
In SQL there are several types of JOIN, what is the difference between INNER JOIN, LEFT JOIN, CROSS JOIN, RIGHT JOIN and FULL JOIN?
3
In SQL there are several types of JOIN, what is the difference between INNER JOIN, LEFT JOIN, CROSS JOIN, RIGHT JOIN and FULL JOIN?
4
Being minimalist, and considering that A is always the table on the left, and B on the right:
Inner Join = only records linked in tables A and B
Left Join = all records of A, only the linked records of B.
Right Join = all records of B, only the linked records of A.
Cross Join = all linked records of A and B, all lines of A and all lines of B, and replicas of lines of A and B with variations between records of the same tables.
Full Join = Left Join and Right Join together. Lines that are not connected do not appear.
Links:
Browser other questions tagged sql database join
You are not signed in. Login or sign up in order to post.
You may help: http://answall.com/q/6441/6454
– stderr
It helped, but the explanation of
CROSS JOIN.– Florida
I understand @Bacco it would be good to close by duplicate.
– Florida
@Florida took advantage and added the cross in mine too, so gets more complete ;) - any doubt leave comment there, I try to clarify if you can. I was stalling to put, because I had not imagined how to make the graph, but I think today I got a reasonable solution
– Bacco