Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

2.9.1 Data grouping

If a value is repeated in a specified column, all the items with that value can be grouped as a single item in the retrieval results. The GROUP BY clause performs this grouping. The AVG, SUM, MAX, MIN, and COUNT set functions, respectively, can be used to obtain the average value, total value, maximum value, minimum value, and rows count of each group.

Figure 2-35 shows an example of data grouping in which product codes are grouped and the total of each group's ordered quantities is extracted from the stock table.

Figure 2-35 Data grouping example

[Figure]