Menu

SQL Joins

INNER JOIN

    SELECT * 
    FROM T1
    INNER JOIN T2 ON T1.key = T2.key

LEFT JOIN

    SELECT * 
    FROM T1
    LEFT JOIN T2 ON T1.key = T2.key

LEFT JOIN (Sans Intersection)

    SELECT * 
    FROM T1
    LEFT JOIN T2 ON T1.key = T2.key
    WHERE T2.key is NULL

RIGHT JOIN

    SELECT * 
    FROM T1
    RIGHT JOIN T2 ON T1.key = T2.key

RIGHT JOIN (Sans Intersection)

    SELECT * 
    FROM T1
    RIGHT JOIN T2 ON T1.key = T2.key
    WHERE T2.key is NULL

FULL JOIN (Outer Join or Full Outer Join)

    SELECT * 
    FROM T1
    FULL JOIN T2 ON T1.key = T2.key

FULL JOIN (Sans Intersection)

    SELECT * 
    FROM T1
    FULL JOIN T2 ON T1.key = T2.key
    WHERE T2.key is NULL