Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Joins: Retrieving Data from Several Tables » Inner and outer joins

Inner and outer joins Next Page

Inner joins


By default, joins are inner joins. This means that rows are included in the result set only if they satisfy the join condition.

Example

For example, each row of the result set of the following query contains the information from one Customers row and one SalesOrders row, satisfying the key join condition. If a particular customer has placed no orders, the condition is not satisfied and the result set does not contain the row corresponding to that customer.

SELECT GivenName, Surname, OrderDate
FROM Customers KEY INNER JOIN SalesOrders
ORDER BY OrderDate;
GivenName Surname OrderDate
Hardy Mums 2000-01-02
Aram Najarian 2000-01-03
Tommie Wooten 2000-01-03
Alfredo Margolis 2000-01-06
... ... ...

Because inner joins and key joins are the defaults, you obtain the same result using the following FROM clause.

FROM Customers JOIN SalesOrders