Window aggregate functions return a value for a specified set of rows in the input. For example, you can use window functions to calculate a moving average of the sales figures for a company over a specified time period.

For the purposes of explanation in this chapter, the window aggregate functions are broken up into three categories:

Basic aggregate functions Following is the list of supported basic aggregate functions:

SUM

AVG

MAX

MIN

FIRST_VALUE

LAST_VALUE

COUNT

Standard deviation and variance functions Following is the list of supported standard deviation and variance functions:

STDDEV

STDDEV_POP

STDDEV_SAMP

VAR_POP

VAR_SAMP

VARIANCE

Correlation and linear regression functions Following is the list of supported correlation and linear regression functions: