Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Windows Functions

Windows Functions

Reference: 📖Explanation, 🔫Playground

Window (also, windowing or windowed) functions perform a calculation over a set of rows. I like to think of “looking through the window” at the rows that are being returned and having one last chance to perform a calculation. The window is defined by the OVER clause which determines if the rows are partitioned into smaller sets and if they are ordered. They allow you to add your favourite aggregate function to a non-aggregate query. Similar to Transform is pandas group by clause.

Common Windows Functions

Ranking functions, check playground to work with this

Figure 1:Ranking functions, check playground to work with this

One problem is you cannot add window functions to the WHERE clause.