sql - outer - Difference between JOIN and INNER JOIN
sql left join (5)
Both these joins will give me the same results:
SELECT * FROM table JOIN otherTable ON table.ID = otherTable.FK
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?
INNER JOIN is the default if you don't specify the type when you use the word JOIN.
You can also use LEFT OUTER JOIN or RIGHT OUTER JOIN, in which case the word OUTER is optional, or you can specify CROSS JOIN.
For an inner join, the syntax is:
[INNER] JOIN TableB
(in other words, the "INNER" keyword is optional - results are the same with or without it)
JOIN performs an
INNER JOIN by default.
For all others, one picture is sometimes worth more than hundreds of words:
Image courtesy of Code Project.
No, there is no difference, pure syntactic sugar.
They are functionally equivalent, but
INNER JOIN can be a bit clearer to read, especially if the query has other join types (i.e.
CROSS) included in it.