Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
[Figure: Example of using a set function incorrectly]
In Example 3, the row count for the result is one row for the total of STOCKQTY, but n rows for PRODUCT. Therefore,
this query specification results in an error.
Grouping tables by using parts of character strings
Methods of grouping table data in columns have been explained so far. The following explains a method of grouping
tables by using parts of character strings. Specify a character substring function in the GROUP BY clause. Figure:
Example of grouping tables by using parts of character strings shows an example of the specification. For details on
the character substring function, see 6.3 "Manipulating Numeric Data".
Example 4:
In this example, the city names of column "LOCATION" in the CUSTOMER table are grouped with the
same persons in order to fetch the average age of each location.
75