Saturday, 22 April 2017

sql - Difference between JOIN and INNER JOIN

As the other answers already state there is no difference in your example.



The relevant bit of grammar is documented here



 ::= 

[ { INNER | { { LEFT | RIGHT | FULL } [ OUTER ] } } [ ] ]
JOIN


Showing that all are optional. The page further clarifies that




INNER Specifies all matching pairs of rows are returned. Discards
unmatched rows from both tables. When no join type is specified, this
is the default
.





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



CREATE TABLE T1(X INT);
CREATE TABLE T2(Y INT);

SELECT *

FROM T1
LOOP JOIN T2
ON X = Y;

SELECT *
FROM T1
INNER LOOP JOIN T2
ON X = Y;



enter image description here

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...