Inner Join allows us to pull data from another table.
When to use
Use it when you want to pull data from a table that has something in common with your current table.
SELECT [Last Name], [Blue Widget]
INNER JOIN [dbo].[Orders] ON [Current_Customers].[Customer ID] = [Orders].[Customer ID]
This will display the last name and number of blue widgets purchased by each customer ID. The Customer ID is what each table you are using INNER JOIN on have in common.
If both tables did not have a Customer ID column, this INNER JOIN would not work. In the next 3 modules we cover other types of Joins (Outer, Left, Right).
Hints & tips
- Inner Join lets you pull data from a table that has something in common with your current table.
Lesson notes are only available for subscribers.