Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
specifying search conditions in the WHERE clause improves the processing efficiency of SQL statements. For
example, to derive rows in which PRODUCT is TELEVISION, specify PRODUCT = 'TELEVISION' as the condition in
the WHERE clause of the query specification in the previous example.
6.1.3 Grouping multiple tables that are joined and manipulating data
Specifying multiple tables in the FROM clause to join tables and manipulate data has already been explained. A table
can be derived from the result of the FROM clause in the table expression. Another table can be derived from the
result of a WHERE clause that specifies rows to be processed from the previously derived table. The GROUP BY
clause targets this table for processing. The results of joining multiple tables can be grouped and data manipulated.
The following is an example of specifying these clauses:
Example 1:
In this example, ITMNO and STOCKQTY for products for which the total of ORDER QTY is less than
210 and for which orders exist for more than one CUSTOMER are added. Then, the total values for
ITMNO and STOCKQTY from the STOCK table and the ORDER table are obtained.
[Figure: Example of grouping multiple tables that are joined and manipulating data]
81