PDQ.com mobilePDQ.com desktop
Support

SQL INNER JOIN

Stephanie WarnerStephanie Warner
·

INNER JOIN renders records from two tables (more with use of multiple JOINs) that have matching values in both tables. The column(s) used to join the tables together is the one that includes the matching values. In the result set of an INNER JOIN, the only records included are those where the case is met.

INNER JOIN Syntax:
SELECT Table_1.Column_1, Table_1.Column_2, Table_2.Column_1, Table_2.Column_N....
FROM Table_1
INNER JOIN Table_2
ON Table_1.Matching_Column = Table_2.Matching_Column;

INNER JOIN Example:
Table 1

Table 2

Inner Join Query:

Result Set:

Notice how there are more rows in the ‘Address’ table than there are in the ‘Customers’ table. The result set renders 3 records due to the way the tables JOIN by the ‘address_id’ column. Since there are only 3 records from the ‘Customers’ table with an ‘address_id’ that matches an ‘address_id’ from the ‘Address’ table, there are only 3 rows that are output in the result set.

INNER JOIN may also be referred to as a JOIN in SQL syntax. The meaning is the same and including ‘INNER’ in the syntax is optional and will render the same result(s).


This blog post is part of our SQL series:

SQL Set Operators

SQL UNION vs UNION ALL

SQL LEFT JOIN

SQL Right Join

SQL Full Outer Join

SQL JOINS

Ready to get started with PDQ Deploy & Inventory?

Take our 14-day Free Trial.
This round is on us!

Don't miss the next post!

August 2020 Patch Tuesday Vulnerabilities

August 2020 Patch Tuesday Updates and Vulnerabilities

PDQ.com
© 2020 PDQ.com Corporation

Products

  • Deploy
  • Inventory
  • Enterprise SL
  • Pricing
  • Downloads
  • Licensing
  • Buy