Creating an Inner Join with INNER JOIN

An inner join:

  • Uses a comparison operator (=, <>, <, <=, >, or >=) to match rows from two tables based on the values in common columns from each table. You can retrieve all rows in which the author identifier (the column au_id) is the same in both the tables authors and title_authors, for example.

  • Returns a result that contains only joined rows that satisfy the join condition(s).

  • Is the most common type of join; I’ll give many examples.

To create an inner join:

  • Type:
    SELECT columns
      FROM table1
      INNER JOIN table2
        ON join_conditions
    							
    columns is one or more comma-separated expressions or column names from table1 or table2. table1 and table2 are the names of the joined tables. If the tables have some column ...

Get SQL: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.