SQL Joins CheatSheet
Posted onEstimated reading time: 0 minutes, 55 seconds
This is one of the quickest SQL desk side notes for web developers and php programmers. Simple examples for all types of SQL Joins, such as Left Join, Inner Join, Full Outer Join, and Right Join variations.
Transcribed SQL Joins
SELECT <select_list> FROM TableA A LEFT JOIN TableB B ON A.Key = B.Key
SELECT <select_list> FROM TableA A LEFT JOIN TableB B ON A.Key = B.Key WHERE B.Key IS NULL
SELECT <select_list> FROM TableA A FULL OUTER JOIN TableB B ON A.Key = B.Key
SELECT <select_list> FROM TableA A INNER JOIN TableB B ON A.Key = B.Key
SELECT <select_list> FROM TableA A FULL OUTER JOIN TableB B ON A.Key = B.Key WHERE A.Key IS NULL OR B.Key IS NULL
SELECT <select_list> FROM TableA A RIGHT JOIN TableB B ON A.Key = B.Key WHERE A.Key IS NULL
SELECT <select_list> FROM TableA A RIGHT JOIN TableB B ON A.Key = B.Key
These are called joins, not joints https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=sql+joints, great article though besides that!
@barry, thanks for letting us know. The designer didn’t double check the final PDF with the developers 🙂