Sobes.tech
Middle

What is the difference between Inner Join and Join? How does a regular Join differ from an Inner Join?

sobes.tech AI

Answer from AI

In SQL, the term "JOIN" usually implies "INNER JOIN" by default, unless otherwise specified.

INNER JOIN is an operation that returns only those rows where there are matches in both tables based on the join condition.

Example:

SELECT * FROM A INNER JOIN B ON A.id = B.a_id;

It will return only the records where A.id matches B.a_id.

JOIN without clarification also generally means INNER JOIN, so there is no difference between JOIN and INNER JOIN — they are synonyms.

However, if LEFT JOIN or RIGHT JOIN is used, then all records from the left or right table are returned, respectively, even if there are no matches in the other table.

In summary:

  • INNER JOIN and JOIN are the same, returning only matching records.
  • There is a difference between INNER JOIN and other JOIN types (LEFT, RIGHT, FULL), but not between JOIN and INNER JOIN.
What is the difference between Inner Join and Join… - sobes.tech