O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required