Using the HCL®
OneDB® extension
syntax, the following query shows an outer join that is the result
of an outer join of each of two tables to a third table. In this third
type of outer join, join relationships are possible only between the
dominant table and the subservient tables.Figure 1: Query
SELECT c.customer_num, c.lname, o.order_num,
order_date, call_dtime
FROM customer c, OUTER orders o, OUTER cust_calls x
WHERE c.customer_num = o.customer_num
AND c.customer_num = x.customer_num
ORDER BY lname
INTO TEMP service;
The query individually joins the subservient tables orders and cust_calls to
the dominant customer table; it does not join the two subservient
tables. An INTO TEMP clause selects the results into a temporary table
for further manipulation or queries, as the result shows.Figure 2: Query result
If Query had
tried to create a join condition between the two subservient tables o and x,
as the following query shows, an error message would indicate the
creation of a two-sided outer join.Figure 3: Query