Zum Inhalt springen

Fensterfunktion (SQL)

aus Wikipedia, der freien Enzyklopädie
Dies ist eine alte Version dieser Seite, zuletzt bearbeitet am 5. März 2008 um 23:57 Uhr durch en>Macrakis (a little more content). Sie kann sich erheblich von der aktuellen Version unterscheiden.

Vorlage:AfDM Vorlage:Context 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_CLAUSE> :: =
   OVER ( [ PARTITION BY <expr>, ... ]
          [ ORDER BY <expression> ] )

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

See also

Vorlage:Software-stub