The JOIN
syntax retrieves the same columns from two or more database tables or databases. Meanwhile, the INNER JOIN
is functionally the same as the JOIN
; both produce the same results.
The comparison operator is used to match rows from two tables based on shared values from each table.
The JOIN
statement creates ambiguity about which kind of JOIN the developer refers to because there are multiple JOIN statements such as: Outer Join
, Left Outer Join
, Right Outer Join
. Therefore, INNER JOIN
is an excellent approach to avoid such ambiguity.
The syntax of the JOIN
statements varies, so we need to specify the right one. As JOIN
and INNER JOIN
have the same function, we might neglect the word INNER while coding.
JOIN
statementLet’s view the syntax of the JOIN
statement.
SELECT *FROMTableNo1 JOIN TableNo2ON TableNo1.columnName = TableNo2.columnName;
INNER JOIN
statementLet’s view the syntax of the INNER JOIN
statement.
SELECT *FROMTableNo1 INNER JOIN TableNo2ON TableNo1.columnName = TableNo2.columnName;
Note: Both of these queries produce the same results.