Mysql JOIN types

Considering the fact  I'm not growing any younger and start forgetting things, here's a very short hands on self reminder article about mysql join types.


JOIN

SELECT stuff FROM a JOIN b ON a.x = b.y
returns only records from a that have correspondent in b




LEFT JOIN

SELECT stuff FROM a LEFT JOIN b ON a.x = b.y
returns all records from a, no matter if they have correspondent in b or not




RIGHT JOIN

SELECT stuff FROM a RIGHT JOIN b ON a.x = b.y
returns all records from b, no matter if they have correspondent in a or not




INNER JOIN


equivalent to simple JOIN




LEFT OUTER JOIN
RIGTH OUTER JOIN


OUTER
is needed for ODBC compatibility. it doesn't do anything.