The sel_ojoin1.sql command file

The following example command file uses a simple outer join on two tables. The use of the keyword OUTER in front of the cust_calls table makes it the subservient table. An outer join causes the query to return information about all customers, even if they do not make calls to customer service. All rows from the dominant customer table are retrieved, and null values are assigned to corresponding rows from the subservient cust_calls table.
SELECT c.customer_num, c.lname, c.company, 
     c.phone, u.call_dtime, u.call_descr
   FROM customer c, OUTER cust_calls u
   WHERE c.customer_num = u.customer_num;

Copyright© 2019 HCL Technologies Limited