Select Page

What’s the difference between RIGHT, LEFT, OUTER, INNER, JOIN

The difference is the way the tables are joined if no common records are available.

RIGHT – RIGHT JOIN is the opposite of LEFT JOIN and the same as RIGHT OUTER JOIN. Shows all records from the right table and only matching records from the left table.

LEFT – LEFT JOIN shows all records from the left table does not matter if matching records in the right table exists or not. Also the same as LEFT OUTER JOIN.

JOIN – JOIN is the same as INNER JOINJOIN means to only show records common to both tables. Will only show records if the same ID value exists in all tables used. If we have a product’s table and a categories table, both have columns with name product_id. If the product_id in the product’s table does not match the product_id in the categories table. No results will show.

Last Updated On March 23, 2018

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.