July 2016
Beginner
256 pages
6h 44m
English
© Clare Churcher 2016
Clare Churcher, Beginning SQL Queries, 10.1007/978-1-4842-1955-3_9
Clare Churcher1
(1)Studio B Productions, Great Neck, New York, USA
Window functions were added to standard SQL in 2003 and provide considerable extra capability for dealing with aggregation. Window functions allow us to perform aggregates on a “window” of data based upon the current row. This provides an elegant way to specify queries to perform actions such as ranking, running totals, and rolling averages. Window functions also provide considerable flexibility when it comes to grouping data for aggregation as they allow a single query to have several different groups or partitions. It is also possible to reference the data contributing to ...