Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between JOIN and INNER JOIN

Both these joins will give me the same results:

SELECT * FROM table JOIN otherTable ON table.ID = otherTable.FK 

vs

SELECT * FROM table INNER JOIN otherTable ON table.ID = otherTable.FK 

Is there any difference between the statements in performance or otherwise?

Does it differ between different SQL implementations?

like image 775
driis Avatar asked Feb 19 '09 14:02

driis


People also ask

Whats 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.

Which is better join or inner join?

'Inner join' is better, although it is equivalent to 'join' in performance as well as function.

What is the difference between inner join and right join?

What is the difference between INNER JOIN and RIGHT JOIN? Inner join returns only the matching rows between both the tables, non-matching rows are eliminated. Right Join or Right Outer Join returns only the matching rows between both the tables, plus non-matching rows from the right table.

What is difference between inner join and outer join?

The major difference between inner and outer joins is that inner joins result in the intersection of two tables, whereas outer joins result in the union of two tables.


1 Answers

They are functionally equivalent, but INNER JOIN can be a bit clearer to read, especially if the query has other join types (i.e. LEFT or RIGHT or CROSS) included in it.

like image 185
palehorse Avatar answered Oct 05 '22 13:10

palehorse