JOIN Queries
In Amazon Athena, INNER and OUTER joins are supported.
The following examples use tables in the Northwind database to show how to join Amazon Athena tables:
The query below returns the ContactName and the OrderDate of every customer who has an order:
SELECT Orders.OrderDate, Customers.ContactName FROM Customers INNER JOIN Orders ON Customers.CustomerID=Orders.CustomerIDOr similarly the outer join below returns the ContactName of all customers and the OrderDate of any associated orders:
SELECT Orders.OrderDate, Customers.ContactName FROM Customers OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID