Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sql

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

like image 207
Surya Avatar asked Oct 09 '13 08:10

Surya


People also ask

What's the difference between inner join and outer join?

The biggest difference between an INNER JOIN and an OUTER JOIN is that the inner join will keep only the information from both tables that's related to each other (in the resulting table). An Outer Join, on the other hand, will also keep information that is not related to the other table in the resulting table.

Does inner join have duplicates?

The answer is yes, if there are any. If there are duplicate keys in the tables being joined.

Does outer join contain duplicates?

Inner join will give you the records that have the same values in the joined columns between the 2 tables. From what you are saying, the 2 tables you are comparing are more or less the same, and full outer join giving you records from both tables, chances are you are going to get a lot of duplicates.

What is the difference between inner join and join?

Difference between JOIN and INNER JOINJOIN returns all rows from tables where the key record of one table is equal to the key records of another table. The INNER JOIN selects all rows from both participating tables as long as there is a match between the columns.


1 Answers

This is the best and simplest way to understand joins:

enter image description here

Credits go to the writer of this article HERE

like image 196
Radu Gheorghiu Avatar answered Sep 20 '22 00:09

Radu Gheorghiu