Hitachi

Hitachi Advanced Database SQL Reference


7.23 Window functions

Using a window function, you can specify a range of rows derived from the results of a table expression, and then determine aggregated values for the rows in that range.

The window functions are shown in the following table:

Table 7‒27: List of window functions

No.

Window function

Description

1

RANK

Determines the ranking of the rows in an ordered set of rows. The ranking values might not be contiguous integer values.

2

DENSE_RANK

Determines the ranking of the rows in an ordered set of rows. The ranking values will be contiguous integer values.

3

CUME_DIST

Determines the relative position of a row in an ordered set of rows. The CUME_DIST of row R is the number of rows that are in front of R in the window (partition) or that have the same sort key value as R, divided by the number of rows in the window (partition) of R.

4

ROW_NUMBER

Assigns a unique number to each row in an ordered set of rows.

5

Set function

Determines the value of a set function with respect to a window frame.

Organization of this section