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?
No, there is no difference, pure syntactic sugar.
Just typing
JOIN
performs anINNER JOIN
by default.For all others, one picture is sometimes worth more than hundreds of words:
Image courtesy of Code Project.
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
orRIGHT
orCROSS
) included in it.INNER JOIN = JOIN:
OR
As the other answers already state there is no difference in your example.
The relevant bit of grammar is documented here
Showing that all are optional. The page further clarifies that
The grammar does also indicate that there is one time where the
INNER
is required though. When specifying a join hint.See the example below
Similarly with
OUTER JOINs
, the word"OUTER"
is optional. It's theLEFT
orRIGHT
keyword that makes theJOIN
an"OUTER" JOIN
.However for some reason I always use
"OUTER"
as inLEFT OUTER JOIN
and neverLEFT JOIN
, but I never useINNER JOIN
, but rather I just use"JOIN"
: