INNER JOIN Operation Example


SQL statement



Sum([Unit Price] * [Quantity]) AS [Sales],
[First Name] & " " & [Last Name] AS [Name]
FROM [Order Details], Orders, Employees,
Orders INNER JOIN [Order Details]
ON Orders.[Order ID] = [Order Details].[Order ID],
Employees INNER JOIN Orders
ON Employees.[Employee ID] = Orders.[Employee ID]
GROUP BY [First Name] & " " & [Last Name]

Creates two equi-joins: one between the Order Details and Orders tables, and another between the Orders and Employees tables.  This is necessary because the Employees table doesn't contain sales data, and the Order Details table doesn't contain employee data.  The query produces a list of employees and their total sales.