Notatnik techniczny

SQL JOINS – wizualizacja

LEFT INNER JOIN

 SELECT <columns>
 FROM Table_A A LEFT INNER JOIN TABLE_B
 ON A.Key = B.Key

LEFT INNER JOIN

LEFT INNER JOIN WITH NULL

SELECT <columns>
FROM Table_A A LEFT INNER JOIN TABLE_B
ON A.Key = B.Key
WHERE B.Key IS NULL

LEFT INNER JOIN NULL

RIGHT INNER JOIN

SELECT <columns>
FROM Table_A A RIGHT INNER JOIN TABLE_B
ON A.Key = B.Key

RIGHT INNER JOIN

RIGHT INNER JOIN WITH NULL

SELECT <columns>
FROM Table_A A RIGHT INNER JOIN TABLE_B
ON A.Key = B.Key
WHERE A.Key IS NULL

RIGHT INNER JOIN NULL

INNER JOIN

SELECT <columns>
FROM Table_A A INNER JOIN TABLE_B
ON A.Key = B.Key

INNER JOIN

FULL OUTHER JOIN

SELECT <columns>
FROM Table_A A FULL OUTHER JOIN TABLE_B
ON A.Key = B.Key

FULL OUTHER JOIN

FULL OUTHER JOIN WITH NULL

SELECT <columns>
FROM Table_A A FULL OUTHER JOIN TABLE_B
ON A.Key = B.Key
WHERE A.Key IS NULL OR B.Key IS NULL

FULL OUTHER JOIN NULL