Select (SQL): Difference between revisions

Content deleted Content added
revert - rm promotional link disguised as a ref
Line 649:
 
For example,
{{sxhl|2=tsql|
 
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:
{{sxhl|2=bnf|1=
 
<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.