Summary
In this chapter, you learned about the window functions, which generate output for a row based on its position inside the dataset or subgroups within the dataset. This is different from the simple functions you learned in Chapter 3, SQL for Data Preparation, that generates an output for a row regardless of the characteristics of the dataset, and different from the aggregate functions you learned in Chapter 4, Aggregate Functions for Data Analysis, that generates an output for all rows in a dataset or subgroups in the dataset.
You learned some of the most common window functions including COUNT
, SUM
, and RANK
. You also learned how to construct a basic window using OVER
. The output of window function depends on the current row's position in the dataset or subgroups within the dataset, which is called partition, as well as the collection of rows required by the calculation, which is called window. As such there are several keywords that may impact how the calculation...