Select (SQL) - Window Function

Window Function

A window function in SQL:2003 is an aggregate function applied to a partition of the result set.

For example,

sum(population) OVER( PARTITION BY city )

calculates the sum of the populations of all rows having the same city value as the current row.

Partitions are specified using the OVER clause which modifies the aggregate. Syntax:

:: = OVER ( )

The OVER clause can partition and order the result set. Ordering is used for order-relative functions such as row_number.

Read more about this topic:  Select (SQL)

Famous quotes containing the words window and/or function:

    Lovers, forget your love,
    And list to the love of these,
    She a window flower,
    And he a winter breeze.
    Robert Frost (1874–1963)

    The press and politicians. A delicate relationship. Too close, and danger ensues. Too far apart and democracy itself cannot function without the essential exchange of information. Creative leaks, a discreet lunch, interchange in the Lobby, the art of the unattributable telephone call, late at night.
    Howard Brenton (b. 1942)