List of Window Functions
ANSI SQL specifies that any aggregate function may also be used as a window function. Oracle and SQL Server largely follow the standard in that respect, so you’ll find that you can take just about any aggregate function (certainly the standard ones) and apply to it the window function syntax described in the preceding sections.
In addition to the aggregate functions, ANSI SQL defines the window functions described in the following sections. Only Oracle and SQL Server currently implement these functions. All examples use the following table and data, which is a variation on the ODD_NUMS table used earlier to illustrate the concepts of partitioning, ordering, and grouping:
SELECT * FROM test4;
NUM ODD
---------- ----------
0 0
1 1
2 0
3 1
3 1
4 0
5 1Platform-specific window functions for Oracle (there are none for SQL Server) are included in the lists found in the section “Platform-Specific Extensions,” later in this chapter.