Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
Join tables
In Example 2, all rows in the ORDER table and STOCK table are in the table derived from the WHERE clause. Some
rows that are not in the ORDER or STOCK table may also be present depending on the conditions. To also fetch rows
that do not satisfy the conditions, use a join table. A join table can be used to also fetch rows which do not satisfy the
join specification fetch conditions, but which are in the tables specified by the join type. When LEFT is coded as the
outer join type, all rows of the table to the left of the join type are fetched. When RIGHT is coded, all rows of the table
on the right are fetched. A specification example is given below.
Example 3:
In this example, COMPANY, PRODNO, and ORDERQTY are fetched from the COMPANY table and
DAILY_ORDER table for the data in which the values of COMPNO and CUSTOMER are equal. All
rows in the DAILY_ORDER table that have different values for COMPNO and CUSTOMER are also
61