How to use Left Join instead of Inner Join

What is a Join in SQL?

Inner join returns rows when there is at least one match in both tables while Left Join returns rows from the right and matched rows from the left table.

When to use Left Join instead of Inner Join

Left join

When to use Left Join Instead of Inner Join in SQL

To choose which side of the table you want as a focal point.

To return all rows(record) from the left table and matched rows(record)from the right table.

To pull all values including NULL values.

Left Join vs Inner Join

WHILE

Inner join returns rows(record) when there is a match in both tables.

However, Inner joins do not allow ALL or any NULL values.

Please follow and like us:

Leave a Reply

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