The inner join is a set intersection and is the default behavior. This join returns rows that have matching values in both tables:
The following query does an inner join:
SELECT Reservations.ReservationId, Customers.CustomerName,Reservations.Date FROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;
It produces the following result:
ReservationId |
CustomerName |
Date |
123123 |
Alex Hales |
01/02/2018 |
123124 |
Alex Hales |
01/03/2018 |
123125 |
Chris Call |
02/02/2018 |
123126 |
Stuart Broad |
03/02/2018 |
Only rows present in both tables are returned.