SQL Joins CheatSheet

News 27-Jan-2015 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.

SQL Joins

Download the PDF

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

Write to us

or call the number 020 8446 1515


    By contacting us through this web form you agree to our latest GDPR compliant privacy policy, which you can read here.

    Success!
    Data sent. Our manager will contact you shortly
    Benefits

    There is no shortage of web design agencies in London, so why Active Webdezign Ltd? What can we bring to your web design project that we believe our competitors can’t match? The following are our pledges to you, and the reasons we believe that we make the ideal development partner to turn to if you are considering a new website.

    Industries

    In our 20 years of being in business we have been honoured to take on web design projects from a very wide variety of different clients. These include such spheres as in B2B, HealthTech, e-Commerce, retail, education, etc. We could go on.