Windowing Aggregate Function Usage

A major feature of the ISO/ANSI SQL extensions for OLAP is a construct called a window. This windowing extension let users divide result sets of a query (or a logical partition of a query) into groups of rows called partitions and determine subsets of rows to aggregate with respect to the current row.

You can use three classes of window functions with a window: ranking functions, the row numbering function, and window aggregate functions.

Windowing extensions specify a window function type over a window name or specification and are applied to partitioned result sets within the scope of a single query expression. A window partition is a subset of rows returned by a query, as defined by one or more columns in a special OVER clause:

OVER (PARTITION BY col1, col2...)

Windowing operations let you establish information such as the ranking of each row within its partition, the distribution of values in rows within a partition, and similar operations. Windowing also lets you compute moving averages and sums on your data, enhancing the ability to evaluate your data and its impact on your operations.

A window partition is a subset of rows returned by a query, as defined by one or more columns in a special OVER() clause:

OVER (PARTITION BY col1, col2...)

For information on analytical function support of the LONG BINARY and LONG VARCHAR data types, see Unstructured Data Analytics in Sybase IQ > Function Support.

Related reference
CORR Function [Aggregate]
COUNT Function [Aggregate]
EXP_WEIGHTED_AVG Function [Aggregate]
FIRST_VALUE Function [Aggregate]
GROUPING Function [Aggregate]
LAST_VALUE Function [Aggregate]
MAX Function [Aggregate]
MEDIAN Function [Aggregate]
MIN Function [Aggregate]
REGR_AVGX Function [Aggregate]
REGR_COUNT Function [Aggregate]
REGR_INTERCEPT Function [Aggregate]
REGR_R2 Function [Aggregate]
REGR_SLOPE Function [Aggregate]
REGR_SXX Function [Aggregate]
REGR_SXY Function [Aggregate]
REGR_SYY Function [Aggregate]
STDDEV Function [Aggregate]
SUM Function [Aggregate]
STDDEV_POP Function [Aggregate]
STDDEV_SAMP Function [Aggregate]
VAR_POP Function [Aggregate]
VAR_SAMP Function [Aggregate]
VARIANCE Function [Aggregate]
WEIGHTED_AVG Function [Aggregate]