[sql] What is difference between INNER join and OUTER join

Difference between inner and outer join. i am using two table and want to fetch data from both table so which type join we should use owning of that we can solve our problem

This question is related to sql join

The answer is


Inner join matches tables on keys, but outer join matches keys just for one side. For example when you use left outer join the query brings the whole left side table and matches the right side to the left table primary key and where there is not matched places null.


This is the best and simplest way to understand joins:

enter image description here

Credits go to the writer of this article HERE


INNER JOIN: Returns all rows when there is at least one match in BOTH tables

LEFT JOIN: Return all rows from the left table, and the matched rows from the right table

RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table

FULL JOIN: Return all rows when there is a match in ONE of the tables