From the course: Advanced SQL – Window Functions

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Overview and filter clause

Overview and filter clause - SQL Tutorial

From the course: Advanced SQL – Window Functions

Start my 1-month free trial

Overview and filter clause

- [Instructor] My favorite starting point is always right at the end. This is the basic syntax of a window function in all its fame and glory. Don't worry, we're not going to tackle it all at once. I just want you to keep it in the back of your mind as a roadmap. The function is, well, a function. We will cover all three function categories in due time. The function itself is less important for now, because we must first understand how it is processed. The OVER clause defines the window over the dataset, and most of these constructs are filters that limit the scope of the window that our function will see through. If we want the window to cover the whole set we can do without them by specifying a blank OVER clause. This looks less intimidating, right? Examples will follow shortly. FILTER is, well, a filter. Like the WHERE clause, FILTER limits the scope of the window with logical predicates. But unlike the WHERE that…

Contents