From the course: Fundamentals of Data Transformation for Data Engineering

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Windows functions: A quick refresher

Windows functions: A quick refresher

- [Instructor] So before we jump into window functions, I want to provide a quick refresher if you're a bit rusty or if you haven't worked with Window functions in a while, because they can be tricky. And SQL Windows are kind of just like aggregates, but they're aggregates within these things called partitions. So taking MAX, you know, performing that aggregation is both a window and an aggregate, but if you don't specify any partition, you're just taking the MAX of the entire data set and the order is predefined by the function. There is an order in a MAX function. But something like a FIRST_VLAUE can have an order because the FIRST_VALUE function returns the first value of what you're selecting from just like the name would suggest. It can have an order, a partition or a frame, and we'll talk more about those attributes later. But comparing the two are MAX, which is just getting the largest value in a column. And something like a FIRST_VALUE, which is over some frame where we might…

Contents