November 2008
Intermediate to advanced
591 pages
17h 28m
English
SQL2003 specifies the following syntax for window functions:
FUNCTION_NAME(expr) OVER {window_name| (window_specification)}window_specification::= [window_name] [partitioning] [ordering] [framing]partitioning::= PARTITION BYvalue[,value...] [COLLATEcollation_name]ordering::= ORDER [SIBLINGS] BYrule[,rule...]rule::= {value|position|alias} [ASC | DESC] [NULLS {FIRST | LAST}]framing::= {ROWS | RANGE} {start|between} [exclusion]start::= {UNBOUNDED PRECEDING |unsigned-integerPRECEDING | CURRENT ROW}between::= BETWEENboundANDboundbound::= {start| UNBOUNDED FOLLOWING |unsigned-integerFOLLOWING}exclusion::= {EXCLUDE CURRENT ROW | EXCLUDE GROUP | EXCLUDE TIES | EXCLUDE NO OTHERS}